Add trusted-types-eval source expression for script-src#665
Add trusted-types-eval source expression for script-src#665lukewarlow merged 1 commit intow3c:mainfrom
trusted-types-eval source expression for script-src#665Conversation
3a0f58d to
8444566
Compare
|
cc @otherdaniel @koto to gather Google feedback. Mozilla Position Request: mozilla/standards-positions#1032 WebKit Position Request: WebKit/standards-positions#355 |
8444566 to
824fce9
Compare
trusted-eval source expression for script-srctrusted-types-eval source expression for script-src
824fce9 to
1ed7bc6
Compare
ad31238 to
5b4509b
Compare
|
@mikewest if you've got time it'd be brilliant to get an editorial review of this too. Still waiting on some browser positions so won't merge yet. |
5b4509b to
b6e3a19
Compare
This new keyword allows enabling eval only when trusted types are enforced. Such that in browsers that don't support trusted types no eval is allowed.
b6e3a19 to
29f6b70
Compare
|
Failing pipeline here seems to be related to a change already merged, rather than this PR. For now I'll leave it "broken" but happy to address if that's desired. Made a WebKit PR at WebKit/WebKit#38741 so would be good to get this PR merged. Given the above standards positions is there a process for requesting review and approval like whatwg has? |
mikewest
left a comment
There was a problem hiding this comment.
We're working on defining the process for updating this spec, and I do hope we'll land on something similar to WHATWG's.
That said, we discussed this specific item at TPAC (https://github.com/w3c/webappsec/blob/main/meetings/2024/2024-09-26-TPAC-minutes.md#trusted-types-eval), there are positive signals from WebKit (WebKit/standards-positions#355), and Mozilla (mozilla/standards-positions#1032). I think whatever process we end up with would accept that as Good Enough™.
With that in mind, I'm comfortable landing this prior to solidifying a new process. @dveditz, WDYT?
|
Based on todays meeting I'm going to go ahead and merge this. Thanks for the reviews. |
…smaug See w3c/webappsec-csp#665 Differential Revision: https://phabricator.services.mozilla.com/D263352
See w3c/webappsec-csp#665 Differential Revision: https://phabricator.services.mozilla.com/D263352 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1940493 gecko-commit: 95bc6cee58f879df3c2dfb431be9dc6dd5735cd9 gecko-reviewers: smaug
See w3c/webappsec-csp#665 Differential Revision: https://phabricator.services.mozilla.com/D263352 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1940493 gecko-commit: 95bc6cee58f879df3c2dfb431be9dc6dd5735cd9 gecko-reviewers: smaug
…smaug See w3c/webappsec-csp#665 Differential Revision: https://phabricator.services.mozilla.com/D263352 UltraBlame original commit: 95bc6cee58f879df3c2dfb431be9dc6dd5735cd9
…smaug See w3c/webappsec-csp#665 Differential Revision: https://phabricator.services.mozilla.com/D263352 UltraBlame original commit: 95bc6cee58f879df3c2dfb431be9dc6dd5735cd9
…smaug See w3c/webappsec-csp#665 Differential Revision: https://phabricator.services.mozilla.com/D263352 UltraBlame original commit: 95bc6cee58f879df3c2dfb431be9dc6dd5735cd9
See w3c/webappsec-csp#665 Differential Revision: https://phabricator.services.mozilla.com/D263352 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1940493 gecko-commit: 95bc6cee58f879df3c2dfb431be9dc6dd5735cd9 gecko-reviewers: smaug
`script-src 'trusted-types-eval'` exempts `eval` from Trusted Types checks, when Trusted Types is enforced. When Trusted Types is not enforced, this directive has no effect. Guarded by the "TrustedTypesHTML" flag. Spec: w3c/webappsec-csp#665 Bug: 388437274 Change-Id: Ided5fd680b0fee1782148b48cdcc7705f2e745ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7207201 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org> Reviewed-by: Yifan Luo <lyf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1559976}
This new keyword allows enabling eval only when trusted types are enforced. Such that in browsers that don't support trusted types no eval is allowed, unlike with
unsafe-eval. This concept was brought up at previous WebAppSec WG meetings.Implementor Interest:
Mozilla (see New
trusted-types-evalkeyword for CSP script-src mozilla/standards-positions#1032)WebKit (see New
trusted-types-evalkeyword for CSP script-src WebKit/standards-positions#355)Chromium - Not sure how best to get an official Google position but Lukas is supportive per New
trusted-types-evalkeyword for CSP script-src WebKit/standards-positions#355 (comment)Implementation Bugs:
Preview | Diff