You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 ofwindow
'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 callingparent.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?
The text was updated successfully, but these errors were encountered: