Thursday, April 1, 2021

Web Application Potentially Vulnerable to Clickjacking (nginx)

在 nginx 配置文件添加:

add_header X-Frame-Options SAMEORIGIN;


三个选项:
DENY
表示该页面不允许在 frame 中展示,即便是在相同域名的页面中嵌套也不允许。
SAMEORIGIN
表示该页面可以在相同域名页面的 frame 中展示。
ALLOW-FROM URI
表示该页面可以在指定来源的 frame 中展示。
 

注: 在网页中设置meta标签是无用的!例如,<meta http-equiv="X-Frame-Options" content="deny"> 是没有效果的。不要使用这种方式。需要在下面的配置实例中配置HTTP Header的方式来进行配置,X-Frame-Options才会起作用。

 

参考:

https://www.imperva.com/learn/application-security/clickjacking/ 

https://www.jianshu.com/p/51cc683402f0

 

No comments:

Post a Comment

ACL的permit和deny两种含义

 permit 允许    deny 拒绝  permit 匹配    deny 不匹配