-
Notifications
You must be signed in to change notification settings - Fork 35
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
Clarify Speculation Rules header interaction with CSP #327
Comments
/cc @jeremyroman to check my reading
Can you provide a demo page?
It should not apply, by my reading of the spec, since such fetches use the "speculationrules" request destination.
Per spec, it only affects inline speculation rules scripts. |
We are working with a partner. Unfortunately, they mentioned that they dont have access to the specific error producing page anymore (they reverted the speculation rules change) so we cannot reproduce at the moment, but they did share the following screenshot: The Speculation-Rules header for that page was: So its obvious that www.wthubspot.com is not part of their CSP policy. But, should we clarify in the specification that CSP directives are respected for ruleset fetches? Is this intended behaviour? |
But that request destination has I would have expected the The two basic options would seem to be:
Honestly I suspect the former is correct, assuming this is indeed the problem, but would want a CSP expert's take, too. |
How would website owners specify that nonce? The rules retrieved from the header do not involve specific a
Have to see if there are no security implications. Looks okay to me on the surface. Other than that, the wording on the draft at https://wicg.github.io/nav-speculation/speculation-rules.html#content-security-policy-patches-effective-directive, is very confusing. Seems incomplete? |
It would look something like the example I gave later on (appearing as a parameter in the header); this would be a new addition. I certainly agree that this would make the CDN case harder. The CDN would have to parse and potentially modify the CSP header, if one exists. It already potentially has to, because
There are some security implications in contrived cases, at least, but I think they're fairly slight in practice.
All of section 2 is just patches against [CSP]. This particular section should just adds one switch case to this algorithm. In theory making the |
Fair point. I believe then it would be another extra check for CDN deployments to make sure the nonce matches the The least friction solution in my opinion would be to ignore |
I have been able to reproduce what I guessed in #327 (comment), with a minimal header of |
Quick update here -- still need to discuss what is feasible here from our security team's perspective, but summer vacations are affecting availability. |
Thanks @jeremyroman, looking forward to it. Some site owners have responded back that unless they modify their CSP header to remove |
Hello. Based on said discussions, the proposed resolution is to simply not apply CSP to fetches triggered by the Speculation Rules header, as it is outside of CSP's threat model. I'll be updating the spec, so I'll assign this issue to myself. Liviu is handling the implementation. |
Per discussions, this is outside of CSP's threat model. Closes #327.
We have seen that pages that have strict CSP headers (strict-dynamic) set on a page, refuse to load speculation rules from the link in the header.
The specification talks about applying CSP for speculation rules that are added by an inline script. Its unclear from the spec whether the same CSP directive apply to rulesets retrieved using the header?
The
inline-speculation-rules
CSP value allows inclusion of speculation rules from inline<script>
tags, does the same apply for rules dynamically loaded using the Speculation Rules header?The text was updated successfully, but these errors were encountered: