-
Notifications
You must be signed in to change notification settings - Fork 86
immutable Specification
#793
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
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for pulling together a proposal, @MartijnCuppens! At a high level, I wonder whether Can you help me understand the use cases you would have for this directive, and how they fit the model that you're proposing? It might be helpful to frame that in terms of an addition to the "Authoring Considerations" section of the document, to help developers understand when it might be helpful to use this mechanism (which, honestly, I'm not sure I understand myself :) ). Regardless of the mechanics and spelling of the mechanism, it will be necessary to specify the processing model in terms of the specification's algorithms. For example:
Thanks again for putting this up for discussion! |
|
cc @dveditz FYI |
|
Solid feedback @mikewest, thanks.
Those specified in the page can still be split up in 2 categories:
The javascript-injected I didn't add an example of javascript-injected scripts, so I get your confusion. I think the whole concept of javascript-injected policies deserves a section in the CSP spec, because just a couple days ago I didn't even know this was a thing. Not sure if it should all be added to this PR though.
Locking CSP with a header makes sense. However, there sometimes are a couple of reasons why people can not make use of these headers:
Having a header saying "disable metatag policies" would not help those people against javascript-injected policies.
No, once
" Once a policy containing immutable is processed, all further policy declarations (via HTTP headers or elements) are ignored." > which means it would just be ignored, similar to a second
It works the same. Adding
It depends if we're going to treat it like a "real directive" or a boolean flag. If it's just a boolean flag I think console logging (like described) might be enough. It can be classified as a misconfiguration rather than a CSP policy violation. |
Given that part of CSP's threat model is defense against reflected XSS attacks, it seems difficult to draw a meaningful distinction between From a specification and implementation perspective, it's also not clear what "server-sent" means. DOM APIs can change the content upon which the HTML parser executes while it's executing, and I think we'd be somewhat hard-pressed to define what "server-sent
FWIW, the original use case I'm aware of for If you'd like to put up another PR to add text that would make this implication less surprising, we could talk about it!
The core value from my perspective is the ability to commit a document with a policy that we know can't change, as that gives browser vendors some freedom to create more robust enforcement mechanisms (perhaps the network layer could block requests without requiring ductwork to route policy changes all the way back up the stack from the renderer...). If we're still in a situation where documents can change their policies arbitrarily, but only up to a point, then those optimizations aren't possible. The value to developers remains somewhat unclear to me, so I'd again ask to understand the use cases you have for this mechanism, and how they lead you to this design.
My point wasn't that the intentions of your text were difficult to understand. My point was that your text explains them to me, a human reading this PR in particular. In order to integrate the implications of your text into the specification, it's necessary to adjust (at least) the algorithms I've pointed to in order to explain the effect in enough detail for folks who aren't participating in this thread to understand and implement them. :)
You're defining a new thing. There's no "default behavior". :) I think it's probably reasonable for an enforced policy that locks itself down to allow other report-only policies to be applied, but you need to specify that interaction in order for it to be actually clear in the document's text.
I came to the opposite conclusion. If we're trying to give developers a tool that allows them to prevent policies from being applied, it seems reasonable to assume that they'd want to track down places in which policy enforcement was attempted (to correct the ordering of policies they applied, to determine why unexpected policies appeared in the first place, etc). |
Proposal for
immutableproperty.cc @mikewest @annevk
Closes #792
Preview | Diff