Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sandbox data can be stolen by third-party frames #43

Open
adob opened this issue Jun 26, 2017 · 8 comments
Open

Sandbox data can be stolen by third-party frames #43

adob opened this issue Jun 26, 2017 · 8 comments

Comments

@adob
Copy link

adob commented Jun 26, 2017

The sandbox iframe can be navigated to an attacker-controlled URL by another, malicious frame. If the sandbox is sent any user data, it can be captured this way.

PoC: https://jsfiddle.net/urv6tx44/2/

@asvd
Copy link
Owner

asvd commented Jun 27, 2017

Thanks for the point!

The sandbox itself seems to remain secure, i.e. the "untrusted code" (in this case, entered by a user into the console) still cannot affect the main application and reach its data. Right?

Securing the messaging between application and plugin has never been the point of Jailed, though you are right that this concern is a good thing to improve.

@adob
Copy link
Author

adob commented Jun 27, 2017 via email

@asvd
Copy link
Owner

asvd commented Jun 27, 2017

Sure, you are right. Therefore the issue remains open until fixed.

@justinwiley
Copy link

@adob @asvd Can you elaborate on the exact vulnerability here?

Is this attack only possible if the jailed page is run from within another malicious iframe? Would a X-Frame-Options: SAMEORIGIN header prevent this?

@adob
Copy link
Author

adob commented Aug 10, 2017 via email

@subversivo58
Copy link

Would not the correct use of CSP solve the presented problem?

@spielzeugland
Copy link

@adob I tried your sample and it works. Can you explain why it is working? I am wondering why it is possible at all that a "bad" parent frame can manipulate the content of child frame coming from a different origin. Is that because of the Access-Control-Allow-Origin: * header on the iFrame's content?

@Venryx
Copy link

Venryx commented Oct 1, 2020

I'm not sure, but I think @spielzeugland's guess above is correct, that the only reason this exploit works is that the access-control-allow-origin header is set to * on both the jailed demo page main html document, as well as the frame within that demo page.

Access header for demo page itself: (seen in dev-tools, after directly opening: https://asvd.github.io/jailed/demos/web/console)

Access header for the frame within that demo page:

Thus, I believe this exploit is not usable in the wild, since normal websites do not have the access-control-allow-origin header set to *.

(Though correct me if wrong, of course.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants