Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSL iframe in and SSL page from a different domain

Setting up the sandboxes for all these option is not feasible right now. So I am appealing to the community for help. This is a weird one and I just want to know what will work (most importantly in ie) and what wont.

  1. Http page with an iframe containing https from the same domain //no idea
  2. Http page with an iframe containing https from a different domain //no idea
  3. Https page with an iframe containing https from the same domain //no idea
  4. Https page with an iframe containing https from a different domain //no idea
  5. Http page with an iframe containing http from the same domain //I know this works
  6. Http page with an iframe containing http from a different domain //I know this works
  7. Https page with an iframe containing http from the same domain //doubt this works
  8. Https page with an iframe containing http from a different domain //doubt this works

For better reading ;)

╔═════════════════════╦═══╦═══════════════╦══════════════════╦═══════════════════╗
║ Page with an iFrame ║ c ║ inside iFrame ║      domain      ║       works?      ║
╠══════════╦══════════╣ o ╠═══════╦═══════╬══════╦═══════════╬═══════════════════╣
║   http   ║   https  ║ n ║  http ║ https ║ same ║ different ║                   ║
╠══════════╬══════════╣ t ╠═══════╬═══════╬══════╬═══════════╬═══════════════════╣
║     X    ║          ║ a ║       ║   X   ║   X  ║           ║      no idea      ║
╠══════════╬══════════╣ i ╠═══════╬═══════╬══════╬═══════════╬═══════════════════╣
║     X    ║          ║ n ║       ║   X   ║      ║     X     ║      no idea      ║
╠══════════╬══════════╣ i ╠═══════╬═══════╬══════╬═══════════╬═══════════════════╣
║          ║     X    ║ n ║       ║   X   ║   X  ║           ║      no idea      ║
╠══════════╬══════════╣ g ╠═══════╬═══════╬══════╬═══════════╬═══════════════════╣
║          ║     X    ║   ║       ║   X   ║      ║     X     ║      no idea      ║
╠══════════╬══════════╣   ╠═══════╬═══════╬══════╬═══════════╬═══════════════════╣
║     X    ║          ║   ║   X   ║       ║   X  ║           ║ I know this works ║
╠══════════╬══════════╣   ╠═══════╬═══════╬══════╬═══════════╬═══════════════════╣
║     X    ║          ║   ║   X   ║       ║      ║     X     ║ I know this works ║
╠══════════╬══════════╣   ╠═══════╬═══════╬══════╬═══════════╬═══════════════════╣
║          ║     X    ║   ║   X   ║       ║   X  ║           ║  doubt this works ║
╠══════════╬══════════╣   ╠═══════╬═══════╬══════╬═══════════╬═══════════════════╣
║          ║     X    ║   ║   X   ║       ║      ║     X     ║  doubt this works ║
╚══════════╩══════════╩═══╩═══════╩═══════╩══════╩═══════════╩═══════════════════╝

Please help! Thanks in advance.

like image 431
Fresheyeball Avatar asked Mar 28 '12 17:03

Fresheyeball


People also ask

Can I load an iframe from a different domain?

Generally, web application allows script running between pages(parent and iframe pages) in the same domain based on same-origin-policy. Unfortunately it does not support scripts if different domain. The policy does not allow it.

Is iframe cross-origin?

Cross-origin communication in between iframe and it's parent website. Yes, it's not any hack or something, but with simple functions you can communicate in between iframe and it's parent website.

Does iframe work with HTTPS?

Navigating or redirecting to an HTTP URL in an iframe embedded in an HTTPS page is not permitted by modern browsers, even if the frame started out with an HTTPS URL.

What is allow same origin?

allow-same-origin allows the document to maintain its origin; pages loaded from https://example.com/ will retain access to that origin's data. allow-scripts allows JavaScript execution, and also allows features to trigger automatically (as they'd be trivial to implement via JavaScript).


Video Answer


1 Answers

Whether the containing page and the iframe are on the same domain or not doesn't really matter.

  • Page served over http:// with an iframe using an http:// URL: works fine.
  • Page served over http:// with an iframe using an https:// URL: works fine, but you won't be able to ensure the security of the iframe.
  • Page served over https:// with an iframe using an http:// URL: will generate mixed content warnings, thereby introducing a potential security risk, and should be avoided.
  • Page served over https:// with an iframe using an https:// URL: works fine. The users may find it hard to check that the iframe comes from the site they expect. They effectively trust the containing page to do the right thing (see 3-D secure problem).
like image 79
Bruno Avatar answered Sep 21 '22 23:09

Bruno