RESOLVED FIXED235260
"Unrecognized Content-Security-Policy directive 'worker-src'."
https://bugs.webkit.org/show_bug.cgi?id=235260
Summary "Unrecognized Content-Security-Policy directive 'worker-src'."
Kate Cheney
Reported 2022-01-14 17:56:51 PST
"Unrecognized Content-Security-Policy directive 'worker-src'."
Attachments
WIP patch (237.29 KB, patch)
2022-01-14 17:59 PST, Kate Cheney
no flags
WIP patch (333.22 KB, patch)
2022-01-18 20:27 PST, Kate Cheney
no flags
WIP patch (339.95 KB, patch)
2022-01-19 13:17 PST, Kate Cheney
no flags
Patch (339.96 KB, patch)
2022-01-20 08:47 PST, Kate Cheney
no flags
Patch for landing (340.24 KB, patch)
2022-01-27 09:58 PST, Kate Cheney
no flags
Patch (339.42 KB, patch)
2022-01-27 11:25 PST, Kate Cheney
ews-feeder: commit-queue-
Kate Cheney
Comment 1 2022-01-14 17:59:02 PST
Created attachment 449238 [details] WIP patch
Kate Cheney
Comment 2 2022-01-18 20:27:08 PST
Created attachment 449460 [details] WIP patch
Kate Cheney
Comment 3 2022-01-19 13:17:42 PST
Created attachment 449511 [details] WIP patch
Patrick Griffis
Comment 4 2022-01-19 13:38:02 PST
Overall patch looks really good. Was one regression: script-src-strict_dynamic_worker-importScripts.https.html Looks like when it falls back to the `script-src` directive it expects all of its rules to pass including 'strict-dynamic'. I wonder if we match that behavior with all other directives that can fallback to `script-src`.
Patrick Griffis
Comment 5 2022-01-19 13:40:47 PST
And fixed, looks great.
Kate Cheney
Comment 6 2022-01-19 13:42:07 PST
Yes! I found https://github.com/w3c/webappsec-csp/issues/200 which pretty much outlines exactly what you suggested. Hopefully that fixes all the regressions.
Kate Cheney
Comment 7 2022-01-20 08:47:34 PST
Kate Cheney
Comment 8 2022-01-21 09:50:39 PST
Something I could probably clarify in the Changelog is that some worker-src tests are still skipped because they log seemingly random URL paths that change with each test run, making them impossible to write expectations for.
Radar WebKit Bug Importer
Comment 9 2022-01-21 17:57:18 PST
Brent Fulgham
Comment 10 2022-01-27 09:11:06 PST
Comment on attachment 449581 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=449581&action=review Awesome work, Kate! r=me > Source/WebCore/page/csp/ContentSecurityPolicy.cpp:619 > + String consoleMessage = consoleMessageForViolation(ContentSecurityPolicyDirectiveNames::workerSrc, violatedDirective, blockedURL, "Refused to load"); Nit: consoleMessage could be auto. > Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp:155 > +{ I found this ChangeLog comment to be helpful. I wonder if it might be useful to reference here (perhaps with a spec reference): // worker-src defers to child-src, then script-src, then default-src. > LayoutTests/imported/w3c/ChangeLog:90 > + * web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/worker-import-data.https-expected.txt: So exciting to see! :-) > LayoutTests/TestExpectations:-489 > -imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/worker-import-data.https.html [ Skip ] Yes!!! > LayoutTests/imported/w3c/web-platform-tests/content-security-policy/blob/self-doesnt-match-blob.sub-expected.txt:4 > +PASS Expecting logs: ["violated-directive=worker-src","TEST COMPLETE"] :-)
Kate Cheney
Comment 11 2022-01-27 09:58:18 PST
Created attachment 450150 [details] Patch for landing
Kate Cheney
Comment 12 2022-01-27 10:16:08 PST
(In reply to Brent Fulgham from comment #10) > Comment on attachment 449581 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=449581&action=review > > Awesome work, Kate! r=me > thanks for the review! > > Source/WebCore/page/csp/ContentSecurityPolicy.cpp:619 > > + String consoleMessage = consoleMessageForViolation(ContentSecurityPolicyDirectiveNames::workerSrc, violatedDirective, blockedURL, "Refused to load"); > > Nit: consoleMessage could be auto. > Fixed! > > Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp:155 > > +{ > > I found this ChangeLog comment to be helpful. I wonder if it might be useful > to reference here (perhaps with a spec reference): > > // worker-src defers to child-src, then script-src, then default-src. > Ditto, added this in PFL. > > LayoutTests/imported/w3c/ChangeLog:90 > > + * web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/worker-import-data.https-expected.txt: > > So exciting to see! :-) > > > LayoutTests/TestExpectations:-489 > > -imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/worker-import-data.https.html [ Skip ] > > Yes!!! > > > LayoutTests/imported/w3c/web-platform-tests/content-security-policy/blob/self-doesnt-match-blob.sub-expected.txt:4 > > +PASS Expecting logs: ["violated-directive=worker-src","TEST COMPLETE"] > > :-) !!! :) !!
Patrick Griffis
Comment 13 2022-01-27 10:19:26 PST
Will need a simple rebase over r288678
EWS
Comment 14 2022-01-27 10:39:53 PST
Tools/Scripts/svn-apply failed to apply attachment 450150 [details] to trunk. Please resolve the conflicts and upload a new patch.
Kate Cheney
Comment 15 2022-01-27 11:25:10 PST
EWS
Comment 16 2022-01-27 14:12:46 PST
Committed r288701 (246499@main): <https://commits.webkit.org/246499@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 450160 [details].
Note You need to log in before you can comment on or make changes to this bug.