目前,我正在从事Django1.11项目,我使用nginx和https方案部署了我的应用程序。我想提交表单,但不想重新提交,所以我使用了POST/重定向/GET模式。一切正常,并且如Mozilla和chrome所期望的那样,即POST/REDIRECT/GET调用将呈现相应的网页,在重新加载和重新提交时,相同的表单将使403访问被拒绝。只有在测试Microsoft浏览器中的相同视图时,才会出现此问题。在调用POST/REDITECT/GET方法时,它直接抛出403。403的原因是“不引用的理由”。Microsoft在使用POST/重定向/GET模式时转发空HTTP引用程序。
我找到了一个补丁
在HTML模板的<meta name="referrer" content="origin-when-cross-origin" />中添加<head>,现在它对边缘也很好。但是,如果我不在标头中添加这个元标记,那么仍然不知道Edge有什么问题。另外,它是否会导致任何安全漏洞?
Django解释了为什么必须进行推荐检查。
Suppose a user visits http://example.com/
# An active network attacker (man-in-the-middle, MITM) sends a
# POST form that targets https://example.com/detonate-bomb/ and
# submits it via JavaScript.
#
# The attacker will need to provide a CSRF cookie and token, but
# that's no problem for a MITM and the session-independent
# secret we're using. So the MITM can circumvent the CSRF
# protection. This is true for any HTTP connection, but anyone
# using HTTPS expects better! For this reason, for
# https://example.com/ we need additional protection that treats
# http://example.com/ as completely untrusted. Under HTTPS,
# Barth et al. found that the Referer header is missing for
# same-domain requests in only about 0.2% of cases or less, so we can use strict Referer checking.那么,在这种情况下,是否意味着在HTTP中必须在HTML中添加meta来输入xyz源文件呢?如果是的话,它是否会导致中间人攻击的安全漏洞,因为攻击者可能也有http-referer?
我在网络概念上很差,所以如果我身边有什么遗漏或错误,请纠正我。
发布于 2019-02-05 07:28:07
元引用标记与大多数浏览器一起以用户定义的方式传递引用信息。流量仍然是加密的,使用HTTPS的所有好处仍然存在,但是现在您可以将引用数据传递给所有网站,甚至那些使用HTTP的网站。
:当目标具有相同的方案、主机和端口(即子域)时,发送完整的作为引用,而不考虑它是HTTPS还是HTTPS,同时向外部站点发送仅指向原点的引用信息。
基于此,我认为你不会有任何与安全有关的问题。
参考文献:
https://stackoverflow.com/questions/54511611
复制相似问题