-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Should blob: inherit CSP in addition to origin? #2593
Comments
I guess this is kinda handled in https://w3c.github.io/webappsec-csp/#initialize-document-csp sorta. But that's using the CSP of the parent or opener, not the CSP of wherever the blob came from, which is a bit odd. |
And clearly at least Safari found this none too clear... //cc @mikewest |
Same as #2592 (comment) , this is probably fixed in the spec but unsure if it's fully tested. |
I think we can duplicate this against w3c/FileAPI#142 and #4926, but I'm okay with keeping it open if we want a dedicated tracking issue. |
Hi, I'm reading through the spec to understand the inheritance behavior for local schemes. I'm still trying to figure out if the correct behavior for
According to browsing-the-web.html#navigating-across-documents, "determine navigation params policy container" This matches the CSP spec (#security-inherit-csp) but seems to contradict the behavior defined for blob URLs in @antosart's policy container explainer. Am I reading it wrong?
In wpt/content-security-policy/inheritance, all tests concerning If the plan is to inherit the policy from the creator, the CSP of the navigator could be stripped by navigating to a |
The goal is to inherit the policies from the creator. I believe you are right and there is a bug in the spec. I created #6895 to fix this. Regarding tests, you are right that we don't have specific tests for this. The problem in writing tests here is that no vendor (at least that I know of) implements this at the moment, although in chrome we would like to address this at some point. (Note that since blob URLs can only be navigated from the same-origin, I believe the security implications of this are very low.) I think we should merge the tests you created, though, even if they are failing on all vendors. |
I see nothing involving CSP anywhere in https://w3c.github.io/FileAPI/ and I don't see the blob steps in https://fetch.spec.whatwg.org/#basic-fetch doing anything with CSP. There's nothing in the HTML spec that would give blob: any particular CSP.
So it looks to me like things loaded from blob: do not have CSP applying to them, per spec.
Using this testcase:
I see the following behavior:
The text was updated successfully, but these errors were encountered: