【发布时间】:2017-08-19 18:21:48
【问题描述】:
我正在从 X-Frame-Options 迁移到内容安全策略以修复点击劫持漏洞。我的应用程序曾经在 hte X-Frame-Options 标头中设置 SAMEORIGIN 策略。 Content-Security-Policy 中的等效选项是什么?
【问题讨论】:
标签: content-security-policy x-frame-options
我正在从 X-Frame-Options 迁移到内容安全策略以修复点击劫持漏洞。我的应用程序曾经在 hte X-Frame-Options 标头中设置 SAMEORIGIN 策略。 Content-Security-Policy 中的等效选项是什么?
【问题讨论】:
标签: content-security-policy x-frame-options
X-Frame-Options: SAMEORIGIN➡Content-Security-Policy: frame-ancestors 'self'
MDN CSP: frame-ancestors 文章有更多详细信息。
https://w3c.github.io/webappsec-csp/#frame-ancestors-and-frame-options 这么说:
该指令类似于多个用户代理已经实现的
X-Frame-Options标头。 'none' 源表达式大致相当于该标头的DENY、'self' 到SAMEORIGIN,等等。
【讨论】: