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

Eval, callerRealm and calleeRealm #539

Closed
antosart opened this issue Feb 18, 2022 · 3 comments
Closed

Eval, callerRealm and calleeRealm #539

antosart opened this issue Feb 18, 2022 · 3 comments

Comments

@antosart
Copy link
Member

antosart commented Feb 18, 2022

According to https://w3c.github.io/webappsec-csp/#can-compile-strings, I have the impression that window.eval should be gated behind both the CSP of window's document and the CSP of the context calling the function.

In particular, if a parent document A without CSP has a same-origin child document B with CSP: script-src 'self', then calling parent.contentWindow.eval() from B should throw.

This does not seem to be the case in any of the major vendors, see
https://wpt.fyi/results/content-security-policy/unsafe-eval/eval-in-iframe.html?label=pr_head&max-count=1&pr=32898
which tests the PR web-platform-tests/wpt#32898.

Am I missing something here?

@annevk
Copy link
Member

annevk commented Feb 18, 2022

Based on whatwg/html#271 @domenic might be able to help with this, although it's been a while.

@domenic
Copy link
Contributor

domenic commented Feb 18, 2022

Dupe of #438 ?

@antosart
Copy link
Member Author

Indeed, thanks @domenic!

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

3 participants