-
Notifications
You must be signed in to change notification settings - Fork 79
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
Use "navigation request's policy container's CSP list" instead of "navigation request's client's global object's CSP list" #692
Conversation
…vigation request's client's global object's CSP list" Complements #494 in order make the spec consistent. Preparation to fix whatwg/html#4651.
I think the problem with this is that navigation request's policy container is initially "client" and is only updated to the source document's policy container thing during fetch (https://fetch.spec.whatwg.org/#concept-request-policy-container), while javascript: url navigations do not go through fetch. I think if you want this to work you need to set navigation request's policy container before this check is called from html. Or am I missing anything? |
Correct. There seems to be another issue, which should be addressed outside of this PR: The request's policy container is set only in 1, step 12. "should navigation request of type be blocked by Content Security Policy?" is called from 2, step 19.3. 1 is called from step 19.5 of 2. So during the first iteration of the while-loop at step 19 of 2, the request's policy container will be its default value, "client". 3 doesn't handle "client", though.
Yes. The call from html, 4, step 5 is already broken since the request's client isn't set. A corrective way forward here would be to merge this PR only together with setting the navigation request's policy container in the HTML spec. WDYT?
Footnotes |
Right! Thanks for the deep investigation, this makes sense to me. I agree the best thing is to set navigation request's policy container in html before calling the CSP check. |
Blocked on whatwg/html#10796 |
This allows HTML to pass in the correct CSP list, to help fix whatwg/html#10796. See also: whatwg/html#10949 and w3c#494. Closes w3c#692 by superseding it.
This allows HTML to pass in the correct CSP list, to help fix whatwg/html#10796. See also: whatwg/html#10949 and w3c#494. Closes w3c#692 by superseding it.
After some more discussion in whatwg/html#10949, it turns out this PR works well as-is, and we only needed to fix HTML. Please merge it. |
Closes #10796, by passing along the intended snapshotted source CSP instead of attempting to look up the policy container from the request (which will not work when it's left as "client"). w3c/webappsec-csp#692 is also necessary to fully get the intended behavior.
I've merged the HTML PR, so please merge this whenever it is convenient! |
Thanks @domenic! |
Complements #494 in order to make the spec consistent.
Preparation for fixing whatwg/html#4651.
Preview | Diff