[wpt-sync] Sync PR 64491 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=322934
Categories
(Core :: DOM: Security, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 64491 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/64491
Details from upstream follow.
Roberto Rodriguez <roberto_rodriguez2@apple.com> wrote:
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=322934
WebKit export from bug: CSP style-<!---->src-<!---->attr does not block a style attribute parsed in a document with no browsing context
<pre>
CSP style-src-attr does not block a style attribute parsed in a document with no browsing contextStyledElement::styleAttributeChanged() checks a style attribute against the policy of the
element's own document when the attribute is set. A document created by DOMParser,
createHTMLDocument or a template has no browsing context and starts with an empty policy,
so the check allows the attribute and the parsed style stays on the element. When the
element moves into a page whose policy sets style-src-attr to none, nothing checks the
style again and it is applied. CSP Level 3 4.2.3 defines this check, and HTML section
3.2.6.5 requires that blocked style rules are not applied to the element.Fix by checking the style attribute against the policy of the document returned by
contextDocument(). That is the document recorded as the creator of a DOMParser result,
a createHTMLDocument document or template contents, and the element's own document when
none is recorded. Add three web-platform tests for the DOMParser, createHTMLDocument
and template paths.WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=322934">https://bugs.webkit.org/show_bug.cgi?id=322934</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/322461@main">https://commits.webkit.org/322461@main</a>
</pre>
| Assignee | ||
Updated•9 days ago
|
| Assignee | ||
Comment 1•9 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=117975
| Assignee | ||
Comment 2•8 days ago
|
||
CI Results
Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 45 tests and 2 subtests
Status Summary
Firefox
OK : 3[GitHub] 43[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, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 6[GitHub] 86[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, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL : 3
Chrome
OK : 2
PASS : 5
TIMEOUT: 1
NOTRUN : 1
Safari
OK : 3
PASS : 6
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /content-security-policy/style-src/style-src-error-event-fires.html [wpt.fyi]:
SKIP - /content-security-policy/style-src/style-src-inline-style-nonce-blocked-error-event.html [wpt.fyi]:
SKIP - /content-security-policy/style-src/inline-style-allowed-while-cloning-objects.sub.html [wpt.fyi]
- inline-style-allowed-while-cloning-objects 19:
FAIL - inline-style-allowed-while-cloning-objects 20:
FAIL
- inline-style-allowed-while-cloning-objects 19:
- /content-security-policy/style-src/style-blocked.html [wpt.fyi]
- document.styleSheets should contain an item for the blocked CSS.:
FAIL
- document.styleSheets should contain an item for the blocked CSS.:
Tests Disabled in Gecko Infrastructure
Comment 4•6 days ago
|
||
| bugherder | ||
Comment 5•6 days ago
|
||
| bugherder | ||
Description
•