请问django csrf文档中下面句话应该如何理解,djangocsrf,https://docs
请问django csrf文档中下面句话应该如何理解,djangocsrf,https://docs
https://docs.djangoproject.com/en/1.7/ref/contrib/csrf/
In addition, for HTTPS requests, strict referer checking is done by CsrfViewMiddleware. This is necessary to address a Man-In-The-Middle attack that is possible under HTTPS when using a session independent nonce, due to the fact that HTTP ‘Set-Cookie’ headers are (unfortunately) accepted by clients that are talking to a site under HTTPS. (Referer checking is not done for HTTP requests because the presence of the Referer header is not reliable enough under HTTP.)
我试着翻译了一下:
另外,对于https请求,CsrfViewMiddleware执行了严格的referer检查。在https下session无关的场合,强调可能发生中间人攻击是有必要的,因为在https下和网站通信,HTTP的‘Set-Cookie’头(不幸)被客户端接收。(对于http请求不需要做referer 检测,因为呈现的Referer头不是足够可信的)
但不太理解是什么意思?
另外,对于https请求,CsrfViewMiddleware执行了严格的referer检查。
(不但检查csrf cookie,还检查http header里的referer)
这是为了解决https下中间人攻击带来的一个问题。
因为在https下和网站通信,HTTP的‘Set-Cookie’头(不幸)被客户端接收。(对于http请求不需要做referer 检测,因为呈现的Referer头不是足够可信的)
(就是说在https下,受到中间人攻击时,csrf cookie可能被截获。要同时检查referer来确保安全)
编橙之家文章,
相关内容
- 这段python django源码不处理PUT方法带表单什么原因,py
- 怎么处理Python解析服务器json格式数据,pythonjson,RT,服
- django正确使用csrf求高手指点,djangocsrf,每次要做csrf保护
- 有脚本版本好自动更新python方法吗?,有脚python,经常看
- 新手对python列表赋值问题的不解,python列表赋值不解
- python语言中两个不同模块可以互相导入吗?,python语言
- python 钩子如何实现分析流程操作,python钩子,在一个项
- Python多线程进度条progressbar没能达到预期,pythonprogres
- Python文件操作路径错误WindowsError: [Error 32]是什么意思,
- python为excel单元格填充颜色有方法吗?,pythonexcel,使用
评论关闭