检测到目标X-XSS-Protection响应头缺失

详细描述

HTTP X-XSS-Protection 响应头是 Internet Explorer,Chrome 和 Safari 的一个特性,当检测到跨站脚本攻击 (XSS)时,浏览器将停止加载页面。

X-XSS-Protection响应头的缺失使得目标URL更易遭受跨站脚本攻击。

解决办法

将您的服务器配置为在所有传出请求上发送值为“1”(例如已启用)的“X-XSS-Protection”头。对于 Apache,请参阅:
http://httpd.apache.org/docs/2.2/mod/mod_headers.html
对于 IIS,请参阅:
https://technet.microsoft.com/pl-pl/library/cc753133%28v=ws.10%29.aspx
对于 nginx,请参阅:
http://nginx.org/en/docs/http/ngx_http_headers_module.html


实战

IIS下的解决办法

IIS的解决办法

参考:
https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc753133(v=ws.10)

操作方法如下:

X-XSS-Protection = 1

在这里插入图片描述
在这里插入图片描述

apache的解决办法

此处略过,可以参考:
https://blog.csdn.net/lxyoucan/article/details/131725900

校验方法

浏览器F12,查看网络请求,如下:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/lxyoucan/article/details/131728683