gpt4 book ai didi

http-headers - X-XSS-Protection vs CSP

转载 作者:行者123 更新时间:2023-12-04 02:07:13 25 4
gpt4 key购买 nike

据我了解,CSP 可以用于与 X-XSS-Protection 相同的所有事情。和更多。如果您使用 CSP,是否有充分的理由使用 X-XSS-Protection还有?

最佳答案

is there any good reason to use X-XSS-Protection as well?



With some doubts (见下面凯文的评论)答案可能是肯定的。
X-Xss-Protection激活启发式反射 xss 检测功能。反射的 xss 以参数的形式出现,可以很容易地确定潜在攻击的范围。

浏览器执行 HTML。根据定义,浏览器不能为服务器生成的 HTML 代码的数据安全提供任何保证。无法确定受信任的 javascript 与恶意的 javascript ……除非您使用 CSP。 CSP 允许您 选择 浏览器执行什么 javascript。

不允许内联 javascript、eval 或 3rd 方源的强制 CSP 非常可靠且 x-xss-protection对您的大多数用户几乎没有什么好处。

如果您用户的浏览器支持 CSP,那就是。
x-xss-protection IE支持多年。因此,在有人使用 IE < 12 的情况下,CSP 在 x-xss-protection 处无用可以帮助。

所以,是的。两个都。总是。如果每个网站都部署两者,互联网将是一个更安全的世界。

我没有深入挖掘,但我还没有找到使用 CSP 而不是 x-xss-protection 的站点
for i in twitter.com vine.co github.com
do
echo "$i"
curl -Is "https://$i" | grep -iE "(x-xss-protection|content-security-policy)"
done

关于http-headers - X-XSS-Protection vs CSP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31413005/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com