-
Notifications
You must be signed in to change notification settings - Fork 76
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
Suggestion: Use different switch/flag than CSP #1
Comments
I know that @slekies agrees. I think I'd be a little sad if this was a standalone header. We have too many of those already. I could imagine it tying into feature policy, though it's not really the same model. @clelland/@raymeskhoury might have opinions there, as this is somewhat similar to the I'm not sure it's a great fit, given the way FP wants to cascade out of the specific resource, but, whatever. :) |
(That said, this would be a policy governing the security of a page's content. So, you know. :) ) |
I think it expresses the fact that a page opts into an XSS protection ;)
A header name is secondary to actual implementation of the behavior. Can we
postpone it until after we have that?
…On Mon, Sep 18, 2017, 15:43 Mike West ***@***.***> wrote:
(That said, this would be a policy about the security of a page's content.
So, you know. :) )
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAH0q6CwjaBLXnKuXlV8vIITkaXLgFQIks5sjnN5gaJpZM4Pa28v>
.
|
@koto: +1. Obviously, the way we frame the opt-out is not central to the project. It's the way I've spelled it in the prototype, and I think the framing makes sense. But we have tons of time to argue about it. Nothing is set in stone, and this is not the most important problem on our plate. :) |
I've thought about this for some more and if it's only me speaking up loud enough, you can close this issue. If people care about DOM XSS mitigations, they should probably also think about mitigating other cases of XSS. So, CSP seems like a good fit. |
So to expand, there are XSS problems that come from JavaScript, but are certainly not a good fit for this API. For example |
The example you've given is in scope for this API. Similarly, some sinks we couldn't protect in a polyfill (like |
I'll leave this open, because I know @koto and @slekies would be happier if it wasn't mentioned in the same breath as CSP. We can argue about that when we have the fundamentals in place. :) @mozfreddyb: |
Well, there's obvious overlap with CSP that needs a discussion, it seems :) It'd be odd for something to disabled twice when you set a reasonable CSP that includes this new DOM API, no? |
Yes, there is an overlap, I see your point. But, in principle, trusted types enforcement should work even in presence of There's a clear advantage to stuffing their enforcement into CSP (we don't create yet another security header, there's tooling around CSP etc.), but one downside is that we're tied to a mechanism with a clumsy backwards-compatibility story, complex semantics, and a huge misconception of what it provides. Still - we'll have plenty of time to bikeshed this after the implementation. |
@koto: I have opinions about your assertions! But, you know, later. :) |
To document what's currently happening wrt headers: The spec specifies a Some authors actually prefer to keep it in CSP for now (mostly because of existing violation report servers that accept a certain syntax; turns out even in Google not everything supports |
@koto, I'm happy to adjust the spec to match reality if that's where you want this to go. |
Before deciding on the final header, we have to solve #66 and the versioning - cc @otherdaniel (we should file a bug to discuss a versioning scheme). |
I think it would be very confusing to put this in Further, Trusted-Types is simply not CSP; the two things are completely independent and complementary, AFAICT. A separate header field makes this more clear. In particular, when learning Trusted-Types the first question I had is "how does this affect the rest of the CSP policy's enforcement?" AFAICT, it doesn't affect the rest of the CSP policy at all; however, try discovering this by reading the CSP and Trusted-Types specs. Finally, see https://www.mnot.net/blog/2018/11/27/header_compression. We shouldn't have multi-party header fields in general. (Note that the current Trusted-Types syntax also has different semantics than CSP: |
@briansmith Re "the two things are completely independent and complementary, AFAICT", what's your take on #143 ? |
Maybe I'm overlooking something, I don't think it makes sense for CSP to block |
That is true. They work in different ways. To give some context, a switch to CSP was done for a few very tangible reasons:
It's not set in stone yet, especially as the syntax might change e.g. due to #66.
That actually seems to be the behaviour of other CSP directives (apart from
Yes, in the CSP header variant of TT we're not using the JSON notation (policies are just space-separated).
That part is interesting - in general we have two options if we opt to use a separate header. Reusing JSON/JFV (which seems trending in spec world), or writing our own parser. To avoid complexity, I'd lean towards JFV unless there's already a specced parser that works for our purpose. We usually assume that header injection is game over anyway for client side security controls (e.g. double newline injection reveals cookies, set-cookie injection does session fixation). |
I said a million years ago that "I think I'd be a little sad if this was a standalone header." I take that back, if a separate header is the right approach, go for it. Headers for everyone! CSP is convenient. It made the implementation simpler, and doesn't (to me) seem any worse than the existing directives outside of CSP's core (e.g. I don't really have a strong opinion about how we spell the policy delivery mechanism
If we mint a new header, let's base the syntax on https://tools.ietf.org/html/draft-ietf-httpbis-header-structure rather than inventing something new. |
Consider:
This is equivalent to:
In CSP, we didn't want |
That's fair. In principle, you can only go so far with CSP, and it's still not safe under "HTTP header injection" threat model, as the injection can just disable the subsequent CSP with We need to store at least 3 different kinds of data - policy names, report URI / group name, and type names (to support #66). However, in Structured Headers there's no data structure that would allow for two levels of data and at the same time would be safe in that model under header concatenation rules. For each of them comma is the outer separator. With these limitations in place, we either accept the risk and move to a separate headers with Structured Headers syntax, move to a separate header with JSON values and choose a structure that's safe under header concatenation, or stick to CSP with its own parser. I'd say we stick with CSP and extend the current
|
We finally decided to go with CSP (via #191). There's a couple of reasons for that:
|
I know this will cause a bikeshed, but I think the cmplexity in CSP is best avoided for a thing that in itself causes quite dramatic changes in how the DOM works.
The text was updated successfully, but these errors were encountered: