-
Notifications
You must be signed in to change notification settings - Fork 78
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
Allow dynamically enabling/disabling unsafe-eval #87
Comments
Hello, and welcome to the bug you filed several months ago that I'm only just now looking into. :) How would you expect this to look and behave? I'm having trouble coming up with anything. What's the back-compat story? |
@wycats suggested on Twitter that this kind of thing is important for Ember and other frameworks. So let's take another shot at discussing it. As a strawman, given a nonce-based policy:
Good enough? |
This is fine too. But I think that it is easier to ask for the nonce for the API that enables/disables eval. Otherwise migrating old libs as well as asking current libs to pass nonce around for new browsers and support old browsers all becomes a mess. But I am fine with either; the approach you outlined is more secure but more painful to roll out IMO |
Can you spell out what you're thinking in a little more detail? I'm not at all wedded to the strawman. :) |
But as I said even you strawman is fine. I defer to @wycats |
It seems like that boils down to the same thing, just with more verbosity. :) It would allow things like |
well I think we will need a version of your strawman that allows new function and setTimeout with the right nonce. |
And I think we need a version of your strawman that at least sketches out answers to the design questions we started addressing in https://w3c.github.io/webappsec-csp/api/ but with which we never got anywhere. :) While we could make |
IM(layman)O, there are upsides and downsides to both approaches, but it seems as if we want |
Yeah, I don't think we can realistically expect to change |
If changing @arturjanc: FYI. |
My skepticism is about convincing TC39. |
I see. |
Now that we have a directive split of Implementing something like |
One interesting aspect of introducing something along the lines of A directive which governs all JS APIs which evaluate code at runtime (i.e. My (uneducated) guess is that the arguments to WASM eval()-like functions are usually static so the hash-based approach could work well here. |
heh .. just ran into this again today so pinging this thread to annoy Mike :D |
This allows us to limit these unsafe constructs to the cases where you know its happening.
The text was updated successfully, but these errors were encountered: