-
Notifications
You must be signed in to change notification settings - Fork 146
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
Consider a Sec-CH-
prefix for client hint headers
#716
Comments
Please no additional overloading of names. |
OK. Can you expand on that? |
Names are names. I realize that there's a precedent with "Sec-". But it really doesn't scale. If we're serious about this, it needs to be done with a plan that explains how this would work with the next keyword being added. In particular, if the "next" extension is completely orthogonal to this one. |
|
I object to this unless we have a documented and agreed-upon plan how this scheme would work with future keywords. |
|
What if "Next" doesn't automatically always have the properties of "Sec"? |
@reschke apologies, but at least to me, it's still not clear what you're objecting to. |
I'm objecting to the further abuse of overloading names with semantics without having a plan how this would work with future extensions. We dropped "CH-" because we did not need it, right? |
The reason we realize now that it is in fact needed is that we want client-hints to get a free-pass when it's comes to the CORS safelist. That is, we don't want to add every new header to the list. |
FWIW, I don't actually care about this. It's fine with me if Fetch just lists all the headers, and y'all have to send PRs to Fetch to add them. :)
I do care about this. And I especially care that we significantly reduce the risk of the headers containing interesting payloads if we block JavaScript access by prefixing them with |
Right. I can understand the You could document that |
There seems to be concrete value in adding the When it comes to |
Having thought about this a bit more - I'm not very happy with forcing Client Hints to be I could see an argument that each hint should consider whether it needs to be prefixed by BTW, this is why registries were invented... |
I may not expressed myself properly before, but the reasoning for
Does that make our motivation for this clearer? |
Hi Yoav, I think I understood you pretty well. What I'm saying is that whether something is CORS-safe is separable from the original purpose of Some headers might need confidence that they can't be set from JS, while I strongly suspect some may not. |
It's not quite convenience. |
As a specific example of what @annevk is talking about, let's say I'm a server that puts a certain degree of trust in requests with a We know that servers frequently use the presence of custom headers for security purposes (e.g. |
Sec-CH-
prefix for client hint headers.Sec-CH-
prefix for client hint headers
@reschke - can you elaborate on "I object to this unless we have a documented and agreed-upon plan how this scheme would work with future keywords."? What would such agreed plan look like? Let's discuss this more next week at the HTTPWG meeting! (or before, if we can) |
@reschke - friendly ping :) |
I looked at the comments in this issue, and it seems to me everything was already mentioned. Overloading the name with semantics doesn't scale, unless there's a agreed-upon way how new prefixes would be added and combined. Right now, we seem to conflate:
and also
I need we believe to discuss these issues separetely. |
This was discussed at the HTTPWG meeting today. A few highlights:
|
Closed by #776 |
In w3ctag/design-reviews#320, @annevk (re-)raised the question of Client Hints' integration with CORS. One suggestion in that thread is to prefix headers with
Sec-CH-
, which on the one hand makes them trivial to add en masse to the CORS-safelisted list, and on the other prevents JavaScript from setting their values (which in turn limits the risk associated with adding them to the CORS-safelisted list in the first place).I have two concrete proposals for hints (
UA-*
andLang
) that adopt this pattern. Perhaps it's one that could be baked more deeply into the Client Hints infrastructure?/cc @igrigorik @yoavweiss @arturjanc
The text was updated successfully, but these errors were encountered: