Vittorio Ballestra
Vittorio Ballestra

Reputation: 420

Mixed Content , Content-Security-Policy and hash-source

I'd like to open an HTTP Iframe inside an HTTPS page. Of course this is not normally possible as it will trigger an 'mixed-content' violation.

Is there any way to by-pass a mixed content block using "Content-Security-Policy" and hash sources ?

Example:

Will this work ? Is there any other method to make this possible.

note: No upgrade-insecure-requests will not work because the page is a navigational request AND the frame HAS to be served from HTTP.

Upvotes: 0

Views: 857

Answers (2)

sebisnow
sebisnow

Reputation: 2067

What if the server sets the csp child-src to http://mysite/my-frame.html? As I read the definitions it should work.

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/

Upvotes: 0

Francesco
Francesco

Reputation: 1148

No, there's no way to bypass the security block on modern browsers (starting from Firefox 23, Chrome 14, IE9)

Thankfully, most modern browsers block this type of dangerous content by default

ref: https://developers.google.com/web/fundamentals/security/prevent-mixed-content/what-is-mixed-content#mixed-content-types--security-threats-associated

Upvotes: 1

Related Questions