混合内容,Content-Security-Policy 和 hash-source
Mixed Content , Content-Security-Policy and hash-source
我想在 HTTPS 页面中打开 HTTP Iframe。当然这通常是不可能的,因为它会触发 'mixed-content' 违规。
有什么方法可以 by-pass 使用 "Content-Security-Policy" 和哈希源的混合内容块吗?
示例:
http://mysite/my-frame.html
的 sha-256 散列为 sha256-xxxyyy....zzz
只要 CORS headers:
Content-Security-Policy: frame-src sha256-xxxxyyyy....zzz
https://mysite/index.html
包含一个 <iframe src='http://mysite/my-frame.html'>
这行得通吗?有没有其他方法可以做到这一点。
注意:否 upgrade-insecure-requests
将不起作用,因为该页面是导航请求并且必须从 HTTP 提供框架。
不,现代浏览器无法绕过安全块(从 Firefox 23、Chrome 14、IE9 开始)
Thankfully, most modern browsers block this type of dangerous content
by default
如果服务器将 csp child-src
设置为 http://mysite/my-frame.html
怎么办?当我阅读定义时,它应该可以工作。
child-src lists the URLs for workers and embedded frame contents. For example: child-src https://youtube.com would enable embedding videos from YouTube but not from other origins. Use this in place of the deprecated frame-src directive.
https://www.html5rocks.com/en/tutorials/security/content-security-policy/
我想在 HTTPS 页面中打开 HTTP Iframe。当然这通常是不可能的,因为它会触发 'mixed-content' 违规。
有什么方法可以 by-pass 使用 "Content-Security-Policy" 和哈希源的混合内容块吗?
示例:
http://mysite/my-frame.html
的 sha-256 散列为sha256-xxxyyy....zzz
只要 CORS headers:
Content-Security-Policy: frame-src sha256-xxxxyyyy....zzz
https://mysite/index.html
包含一个<iframe src='http://mysite/my-frame.html'>
这行得通吗?有没有其他方法可以做到这一点。
注意:否 upgrade-insecure-requests
将不起作用,因为该页面是导航请求并且必须从 HTTP 提供框架。
不,现代浏览器无法绕过安全块(从 Firefox 23、Chrome 14、IE9 开始)
Thankfully, most modern browsers block this type of dangerous content by default
如果服务器将 csp child-src
设置为 http://mysite/my-frame.html
怎么办?当我阅读定义时,它应该可以工作。
child-src lists the URLs for workers and embedded frame contents. For example: child-src https://youtube.com would enable embedding videos from YouTube but not from other origins. Use this in place of the deprecated frame-src directive.
https://www.html5rocks.com/en/tutorials/security/content-security-policy/