[wpt-sync] Sync PR 64554 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=323021
Categories
(Testing :: web-platform-tests, task, P4)
Tracking
(firefox162 fixed)
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 64554 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/64554
Details from upstream follow.
Roberto Rodriguez <roberto_rodriguez2@apple.com> wrote:
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=323021
WebKit export from bug: [<!---->CSP]<!----> Nonce-<!---->based CSP is bypassed by dangling markup placed before a nonced \<<!---->link><!---->
<pre>
[CSP] Nonce-based CSP is bypassed by dangling markup placed before a nonced <link>Element::isNonceable() implements the CSP "is element nonceable" algorithm
(<a href="https://www.w3.org/TR/CSP3/#is-element-nonceable)">https://www.w3.org/TR/CSP3/#is-element-nonceable)</a> which officially only checks for '<script'
and '<style' in each attribute name and value to catch injected dangling markup and prevent
an unterminated script start tag from stealing a nonce from a legitimate element.
The algorithm currently doesn't check for '<link' even though <link> is nonceable.Fix by also checking for '<link' in each attribute name and value. Nonces apply only to
script, style and link elements, so all three are now covered. Chrome has already made this
change and has proposed updating the CSP spec (<a href="https://github.com/w3c/webappsec-csp/pull/810).">https://github.com/w3c/webappsec-csp/pull/810).</a>A WPT test exists for checking non-nonceable elements
(content-security-policy/script-src/non-nonceable-elements.html)
and WebKit currently fails its '<link' subtests, which this fix addresses. That test only
checks attribute values, so add a second similar test to cover attribute names.WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=323021">https://bugs.webkit.org/show_bug.cgi?id=323021</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/320263@main">https://commits.webkit.org/320263@main</a>
</pre>
| Assignee | ||
Updated•19 days ago
|
| Assignee | ||
Updated•19 days ago
|
| Assignee | ||
Comment 1•19 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=119446
| Assignee | ||
Comment 2•19 days ago
|
||
CI Results
Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 98 tests and 2 subtests
Status Summary
Firefox
OK : 1[GitHub] 96[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 97[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
PASS: 10[GitHub] 221[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 224[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
FAIL: 34
Chrome
OK : 1
PASS: 10
Safari
OK : 1
PASS: 10
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /content-security-policy/script-src/scriptnonce-basic-blocked.sub.html [wpt.fyi]:
SKIP - /content-security-policy/script-src/script-src-1_4_1.html [wpt.fyi]:
OK[Gecko-android-em-14-x86_64-debug-geckoview,Gecko-android-em-14-x86_64-lite-opt-geckoview,Gecko-android-em-14-x86_64-opt-geckoview,Gecko-linux2404-64-debug,Gecko-linux2404-64-opt],SKIP[Gecko-windows11-32-25h2-debug,Gecko-windows11-32-25h2-opt,Gecko-windows11-64-25h2-debug,Gecko-windows11-64-25h2-opt] - /content-security-policy/script-src/tentative/script-url-allowed-by-hash.https.html [wpt.fyi]
- script-src should allow script by its url hash - header:
FAIL - A parseable url-hash should ignore hostname allowlists - header:
FAIL - default-src should allow script by its url hash - header:
FAIL - script-src-elem should allow script by its url hash - header:
FAIL - url hashes should allow dynamically inserted script if allowlisted - header:
FAIL - url hashes should allow redirected scripts - header:
FAIL - dynamically inserted parser-inserted script should be allowed if strict-dynamic-url is present - header:
FAIL - dynamically inserted script inserted by an inline script should be allowed if strict-dynamic-url is present - header:
FAIL - script-src should allow script by its relative url's hash - header:
FAIL - script-src should allow script by its relative url's hash in child directory - header:
FAIL - script-src should allow script by its relative url's hash in an iframe in child dir - header:
FAIL - script-src should allow script in parent dir by its relative url's hash in an iframe in child dir - header:
FAIL - script-src should allow script by its url hash - metatag:
FAIL - A parseable url-hash should ignore hostname allowlists - metatag:
FAIL - default-src should allow script by its url hash - metatag:
FAIL - script-src-elem should allow script by its url hash - metatag:
FAIL - url hashes should allow dynamically inserted script if allowlisted - metatag:
FAIL - url hashes should allow redirected scripts - metatag:
FAIL - dynamically inserted parser-inserted script should be allowed if strict-dynamic-url is present - metatag:
FAIL - dynamically inserted script inserted by an inline script should be allowed if strict-dynamic-url is present - metatag:
FAIL - script-src should allow script by its relative url's hash - metatag:
FAIL - script-src should allow script by its relative url's hash in child directory - metatag:
FAIL - script-src should allow script by its relative url's hash in an iframe in child dir - metatag:
FAIL - script-src should allow script in parent dir by its relative url's hash in an iframe in child dir - metatag:
FAIL
- script-src should allow script by its url hash - header:
- /content-security-policy/script-src/tentative/script-url-blocked-report-contains-hash-dedicated-worker.https.html [wpt.fyi]
- script-specific violation report contains correct urlHash in dedicated worker:
FAIL
- script-specific violation report contains correct urlHash in dedicated worker:
- /content-security-policy/script-src/tentative/script-url-blocked-report-contains-hash-service-worker.https.html [wpt.fyi]
- script-specific violation report contains correct urlHash in service worker:
FAIL
- script-specific violation report contains correct urlHash in service worker:
- /content-security-policy/script-src/tentative/script-url-blocked-report-contains-hash-shared-worker.https.html [wpt.fyi]
- script-specific violation report contains correct urlHash in shared worker:
FAIL
- script-specific violation report contains correct urlHash in shared worker:
- /content-security-policy/script-src/tentative/script-url-blocked-report-contains-hash.https.html [wpt.fyi]
- script-specific violation report contains correct urlHash:
FAIL
- script-specific violation report contains correct urlHash:
- /content-security-policy/script-src/script-src-strict_dynamic_modulepreload_parser_inserted_module.html [wpt.fyi]
- Parser-inserted external module script that is also
modulepreloaded is allowed withstrict-dynamic.:FAIL
- Parser-inserted external module script that is also
- /content-security-policy/script-src/tentative/url-hash-in-header-and-meta.https.html [wpt.fyi]
- more lax meta tag should still allow script:
FAIL - multiple meta tags should apply most strict policy - both lax:
FAIL
- more lax meta tag should still allow script:
- /content-security-policy/script-src/script-src-trusted_types_eval_multiple_policies_blocked.window.html [wpt.fyi]
- Direct
evalis blocked by a second policy withouttrusted-types-eval.:FAIL new Functionis blocked by a second policy withouttrusted-types-eval.:FAIL
- Direct
- /content-security-policy/script-src/script-src-trusted_types_eval_multiple_policies_report_only.window.html [wpt.fyi]
evalis allowed but reported by a report-only policy withouttrusted-types-eval.:FAIL
Tests Disabled in Gecko Infrastructure
- /content-security-policy/script-src/scriptnonce-basic-blocked.sub.html [wpt.fyi]:
SKIP - /content-security-policy/script-src/script-src-1_4_1.html [wpt.fyi]:
OK[Gecko-android-em-14-x86_64-debug-geckoview,Gecko-android-em-14-x86_64-lite-opt-geckoview,Gecko-android-em-14-x86_64-opt-geckoview,Gecko-linux2404-64-debug,Gecko-linux2404-64-opt],SKIP[Gecko-windows11-32-25h2-debug,Gecko-windows11-32-25h2-opt,Gecko-windows11-64-25h2-debug,Gecko-windows11-64-25h2-opt]
Comment 4•14 days ago
|
||
| bugherder | ||
Description
•