Skip to content
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

New trusted-types-eval keyword for CSP script-src #1032

Closed
lukewarlow opened this issue May 28, 2024 · 2 comments
Closed

New trusted-types-eval keyword for CSP script-src #1032

lukewarlow opened this issue May 28, 2024 · 2 comments
Assignees

Comments

@lukewarlow
Copy link

lukewarlow commented May 28, 2024

Request for Mozilla Position on an Emerging Web Specification

Other information

This proposes a new trusted-types-eval keyword for the CSP script-src directive. The main use case for this new keyword is to allow enabling eval only in browsers that support and have Trusted Types enforced. Currently trusted types is used alongside unsafe-eval (if you need eval), which means that in browsers with no trusted types support eval is still allowed (completely unmitigated by the protections TT offer). This new keyword would prevent that situation.

@lukewarlow
Copy link
Author

See #20 for the original position on Trusted Types as a whole which is Positive from mozilla.

@lukewarlow lukewarlow changed the title New trusted-eval keyword for CSP script-src New trusted-types-eval keyword for CSP script-src Jun 18, 2024
@mozfreddyb
Copy link
Contributor

While having to use eval is a generally unfortunate thing, we acknowledge that some websites have painted themselves into a corner such that it's better to use eval only on trusted things rather than all kinds of eval.

There was a slight concern that "trusted..." sounds like a safe thing to do, when it is in fact only a pointer that the check should have been applied elsewhere. But that's pretty much aligned with the general understanding of trust in computer security, so we're OK. Generally, we're happy that this requires a trusted-types directive to be in effect to do anything and has sane back-compat story.

My apologies for not circling back earlier here. After a discussion with our CSP folks internally, I suggest we mark this positive (but without an individual entry in our dashboard, because the change is a bit minor).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants