漏洞名稱:
檢測到目標X-Content-Type-Options、X-XSS-Protection、Content-Security-Policy、Strict-Transport-Security、Referrer-Polic、X-Permitted-Cross-Domain-Policies、X-Download-Options響應頭缺失
修復方法:
修改apache的配置文件httpd.conf,在網站目錄配置下即<Directory "網站目錄">段配置下,添加以下配置,重啟生效
Header always set X-Content-Type-Options nosniff
Header always append X-XSS-Protection '1; mode=block'
Header set Content-Security-Policy "default-src 'self' localhost:8080 'unsafe-inline' 'unsafe-eval' blob: data: ;"
Header add Strict-Transport-Security "value"
Header add Referrer-Policy "value"
Header add X-Permitted-Cross-Domain-Policies "value"
Header add X-Download-Options "value"
劫持:X-Frame-Options未配置
修復方法:
修改apache的配置文件httpd.conf,在<Directory />段配置下,添加以下配置,重啟生效
<Directory />
AllowOverride none
Require all denied
<LimitExcept POST GET>
Require valid-user
</LimitExcept>
</Directory>
HTTP動詞篡改的認證旁路
修復方法:
修改apache的配置文件httpd.conf,在網站目錄配置下即<Directory "網站目錄">段配置下,添加以下配置,重啟生效
Header always append X-Frame-Options "DENY"
或者Header always append X-Frame-Options SAMEORIGIN
X-Frame-Options:值有三個:
(1)DENY:表示該頁面不允許在 frame 中展示,即便是在相同域名的頁面中嵌套也不允許。
(2)SAMEORIGIN:表示該頁面可以在相同域名頁面的 frame 中展示。
(3)ALLOW-FROM https://example.com/:表示該頁面可以在指定來源的 frame 中展示。