Closed Bug 2070546 Opened 2 months ago Closed 2 months ago

[wpt-sync] Sync PR 62477 - [Sanitizer] Fix initialization of default PI allow/remove lists.

Categories

(Core :: DOM: Security, task, P4)

task

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 62477 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/62477
Details from upstream follow.

Daniel Vogelheim <vogelheim@chromium.org> wrote:

[Sanitizer] Fix initialization of default PI allow/remove lists.

Observe the |allowCommentsPIsAndDataAttributes| flag when initializing
a Sanitizer config with neither allow- nor remove-lists for PIs.

Also fix the test case which had malformed test data. This caused the
test to silently fail and hide the bug.

Ref: https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#canonicalize-the-configuration, step 3.*

Fix: 556213916
Change-Id: I80950f53de418f4d2478dfc795fa7364d1435c08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8352664
Commit-Queue: Daniel Vogelheim \<vogelheim@chromium.org>
Reviewed-by: Noam Rosenthal \<nrosenthal@google.com>
Cr-Commit-Position: refs/heads/main@{#1693355}

Component: web-platform-tests → DOM: Security
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 30 tests and 8 subtests

Status Summary

Firefox

OK : 1[GitHub] 30[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: 9[GitHub] 670[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: 48[GitHub] 192[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]

Chrome

OK : 1
PASS: 54
FAIL: 3

Safari

OK : 1
FAIL: 57

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /sanitizer-api/parsehtmlunsafe-with-trustedtypes.tentative.html [wpt.fyi]
    • Document.parseHTMLUnsafe: createParserOptions can inject a sanitizer config: FAIL
    • Document.parseHTMLUnsafe: passing TrustedParserOptions directly works: FAIL
    • Document.parseHTMLUnsafe: createParserOptions returning 0 fails: FAIL
    • Document.parseHTMLUnsafe: createParserOptions returning 123 fails: FAIL
    • Document.parseHTMLUnsafe: createParserOptions returning "foo" fails: FAIL
  • /sanitizer-api/sanitizer-processing-instructions.html [wpt.fyi]
    • setHTMLUnsafe testcase agnostic/0, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTMLUnsafe testcase agnostic/0, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTML testcase agnostic/0, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTML testcase agnostic/0, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTML testcase agnostic/0, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTMLUnsafe testcase agnostic/0, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTMLUnsafe testcase agnostic/1, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTMLUnsafe testcase agnostic/1, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTML testcase agnostic/1, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTML testcase agnostic/1, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTML testcase agnostic/1, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTMLUnsafe testcase agnostic/1, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTMLUnsafe testcase agnostic/2, "<?Target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTMLUnsafe testcase agnostic/2, "<?Target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTMLUnsafe testcase agnostic/2, "<?Target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTMLUnsafe testcase agnostic/3, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTMLUnsafe testcase agnostic/3, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTMLUnsafe testcase agnostic/3, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTMLUnsafe testcase agnostic/4, "<?target-1 data?><?target-2 data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTMLUnsafe testcase agnostic/4, "<?target-1 data?><?target-2 data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTML testcase agnostic/4, "<?target-1 data?><?target-2 data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTML testcase agnostic/4, "<?target-1 data?><?target-2 data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTML testcase agnostic/4, "<?target-1 data?><?target-2 data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTMLUnsafe testcase agnostic/4, "<?target-1 data?><?target-2 data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTMLUnsafe testcase agnostic/5, "<?target-1 data?><?target-2 data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTMLUnsafe testcase agnostic/5, "<?target-1 data?><?target-2 data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTML testcase agnostic/5, "<?target-1 data?><?target-2 data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTML testcase agnostic/5, "<?target-1 data?><?target-2 data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTML testcase agnostic/5, "<?target-1 data?><?target-2 data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTMLUnsafe testcase agnostic/5, "<?target-1 data?><?target-2 data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTMLUnsafe testcase agnostic/6, "<div><?target data?></div>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTMLUnsafe testcase agnostic/6, "<div><?target data?></div>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTML testcase agnostic/6, "<div><?target data?></div>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTML testcase agnostic/6, "<div><?target data?></div>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTML testcase agnostic/6, "<div><?target data?></div>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTMLUnsafe testcase agnostic/6, "<div><?target data?></div>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTMLUnsafe testcase unsafe-only/0, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTMLUnsafe testcase unsafe-only/0, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTMLUnsafe testcase unsafe-only/0, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTMLUnsafe testcase unsafe-only/1, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTMLUnsafe testcase unsafe-only/1, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTMLUnsafe testcase unsafe-only/1, "<?target data?>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTMLUnsafe testcase unsafe-only/2, "<div><?target data?></div>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTMLUnsafe testcase unsafe-only/2, "<div><?target data?></div>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTMLUnsafe testcase unsafe-only/2, "<div><?target data?></div>": FAIL (Chrome: PASS, Safari: FAIL)
    • setHTMLUnsafe testcase unsafe-only/3, "<div><?target data?></div>": FAIL (Chrome: PASS, Safari: FAIL)
    • ShadowRoot.setHTMLUnsafe testcase unsafe-only/3, "<div><?target data?></div>": FAIL (Chrome: PASS, Safari: FAIL)
    • parseHTMLUnsafe testcase unsafe-only/3, "<div><?target data?></div>": FAIL (Chrome: PASS, Safari: FAIL)
  • /sanitizer-api/sethtml-with-declarative-shadow-root.tentative.html [wpt.fyi]
    • shadowRoot.delegatesFocus does not propagate to the shadow root when shadowrootdelegatesfocus is removed by sanitizer: FAIL
    • shadowRoot.serializable does not propagate to the shadow root when shadowrootserializable is removed by sanitizer: FAIL
    • shadowRoot.clonable does not propagate to the shadow root when shadowrootclonable is removed by sanitizer: FAIL
    • shadowRoot.referenceTarget does not propagate to the shadow root when shadowrootreferencetarget is removed by sanitizer: FAIL
    • shadowRoot.customElementRegistry does not propagate to the shadow root when shadowrootcustomelementregistry is removed by sanitizer: FAIL
    • shadowRoot.adoptedStyleSheets does not propagate to the shadow root when shadowrootadoptedstylesheets is removed by sanitizer: FAIL
  • /sanitizer-api/sethtml-with-trustedtypes-createParserOptions-null.tentative.html [wpt.fyi]
    • TrustedParserOptions.sanitizer() is null when createParserOptions returns empty object: FAIL
    • Element.setHTMLUnsafe: when TrustedParserOptions has null sanitizer, no sanitization occurs: FAIL
  • /sanitizer-api/sethtml-with-trustedtypes-createParserOptions.tentative.html [wpt.fyi]
    • ShadowRoot.setHTMLUnsafe: passing a TrustedParserOptions overrides default policy: FAIL
    • ShadowRoot.setHTMLUnsafe: policy with only createParserOptions allows raw strings when sanitizer is present: FAIL
    • ShadowRoot.setHTMLUnsafe: TrustedParserOptions without sanitizer still requires createHTML: FAIL
    • ShadowRoot.setHTMLUnsafe: exception in default createParserOptions prevents createHTML from running: FAIL
    • ShadowRoot.setHTMLUnsafe: default policy createParserOptions with sanitizer prevents createHTML from running: FAIL
    • Element.setHTMLUnsafe: passing a TrustedParserOptions overrides default policy: FAIL
    • Element.setHTMLUnsafe: policy with only createParserOptions allows raw strings when sanitizer is present: FAIL
    • Element.setHTMLUnsafe: TrustedParserOptions without sanitizer still requires createHTML: FAIL
    • Element.setHTMLUnsafe: exception in default createParserOptions prevents createHTML from running: FAIL
    • Element.setHTMLUnsafe: default policy createParserOptions with sanitizer prevents createHTML from running: FAIL
  • /sanitizer-api/sethtml-with-trustedtypes-immutable.tentative.html [wpt.fyi]
    • createParserOptions doesn't mutate original object: FAIL
    • createParserOptions doesn't mutate sanitizer object: FAIL
    • TrustedParserOptions sanitizer clone testing with config input: FAIL
    • TrustedParserOptions sanitizer clone testing with Sanitizer object input: FAIL
    • TrustedParserOptions sanitizer clone testing with Preset string input: FAIL
  • /sanitizer-api/sethtml-with-trustedtypes.tentative.html [wpt.fyi]
    • ShadowRoot.setHTMLUnsafe: createParserOptions can inject a sanitizer config: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions can inject a sanitizer: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions can override a sanitizer config: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions returning 0 fails: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions returning 123 fails: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions returning "foo" fails: FAIL
    • ShadowRoot.innerHTML: createParserOptions can inject a sanitizer config: FAIL
    • ShadowRoot.innerHTML: createParserOptions can inject a sanitizer: FAIL
    • ShadowRoot.innerHTML: createParserOptions can override a sanitizer config: FAIL
    • ShadowRoot.innerHTML: createParserOptions returning 0 fails: FAIL
    • ShadowRoot.innerHTML: createParserOptions returning 123 fails: FAIL
    • ShadowRoot.innerHTML: createParserOptions returning "foo" fails: FAIL
    • ShadowRoot.beforebegin: createParserOptions can inject a sanitizer config: FAIL
    • ShadowRoot.beforebegin: createParserOptions can inject a sanitizer: FAIL
    • ShadowRoot.beforebegin: createParserOptions can override a sanitizer config: FAIL
    • ShadowRoot.beforebegin: createParserOptions returning 0 fails: FAIL
    • ShadowRoot.beforebegin: createParserOptions returning 123 fails: FAIL
    • ShadowRoot.beforebegin: createParserOptions returning "foo" fails: FAIL
    • ShadowRoot.afterend: createParserOptions can inject a sanitizer config: FAIL
    • ShadowRoot.afterend: createParserOptions can inject a sanitizer: FAIL
    • ShadowRoot.afterend: createParserOptions can override a sanitizer config: FAIL
    • ShadowRoot.afterend: createParserOptions returning 0 fails: FAIL
    • ShadowRoot.afterend: createParserOptions returning 123 fails: FAIL
    • ShadowRoot.afterend: createParserOptions returning "foo" fails: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions with sanitizer prevents createHTML from running: FAIL
    • ShadowRoot.setHTMLUnsafe: exception in createParserOptions is rethrown and prevents createHTML: FAIL
    • ShadowRoot.setHTMLUnsafe: exception in createHTML happens after createParserOptions runs: FAIL
    • ShadowRoot.innerHTML: exception in createParserOptions is rethrown and prevents createHTML: FAIL
    • ShadowRoot.innerHTML: exception in createHTML happens after createParserOptions runs: FAIL
    • ShadowRoot.beforebegin: exception in createParserOptions is rethrown and prevents createHTML: FAIL
    • ShadowRoot.beforebegin: exception in createHTML happens after createParserOptions runs: FAIL
    • ShadowRoot.afterend: exception in createParserOptions is rethrown and prevents createHTML: FAIL
    • ShadowRoot.afterend: exception in createHTML happens after createParserOptions runs: FAIL
    • Element.setHTMLUnsafe: createParserOptions can inject a sanitizer config: FAIL
    • Element.setHTMLUnsafe: createParserOptions can inject a sanitizer: FAIL
    • Element.setHTMLUnsafe: createParserOptions can override a sanitizer config: FAIL
    • Element.setHTMLUnsafe: createParserOptions returning 0 fails: FAIL
    • Element.setHTMLUnsafe: createParserOptions returning 123 fails: FAIL
    • Element.setHTMLUnsafe: createParserOptions returning "foo" fails: FAIL
    • Element.innerHTML: createParserOptions can inject a sanitizer config: FAIL
    • Element.innerHTML: createParserOptions can inject a sanitizer: FAIL
    • Element.innerHTML: createParserOptions can override a sanitizer config: FAIL
    • Element.innerHTML: createParserOptions returning 0 fails: FAIL
    • Element.innerHTML: createParserOptions returning 123 fails: FAIL
    • Element.innerHTML: createParserOptions returning "foo" fails: FAIL
    • Element.outerHTML: createParserOptions can inject a sanitizer config: FAIL
    • Element.outerHTML: createParserOptions can inject a sanitizer: FAIL
    • Element.outerHTML: createParserOptions can override a sanitizer config: FAIL
    • Element.outerHTML: createParserOptions returning 0 fails: FAIL
    • Element.outerHTML: createParserOptions returning 123 fails: FAIL
    • Element.outerHTML: createParserOptions returning "foo" fails: FAIL
    • Element.createContextualFragment: createParserOptions can inject a sanitizer config: FAIL
    • Element.createContextualFragment: createParserOptions can inject a sanitizer: FAIL
    • Element.createContextualFragment: createParserOptions can override a sanitizer config: FAIL
    • Element.createContextualFragment: createParserOptions returning 0 fails: FAIL
    • Element.createContextualFragment: createParserOptions returning 123 fails: FAIL
    • Element.createContextualFragment: createParserOptions returning "foo" fails: FAIL
    • Element.afterbegin: createParserOptions can inject a sanitizer config: FAIL
    • Element.afterbegin: createParserOptions can inject a sanitizer: FAIL
    • Element.afterbegin: createParserOptions can override a sanitizer config: FAIL
    • Element.afterbegin: createParserOptions returning 0 fails: FAIL
    • Element.afterbegin: createParserOptions returning 123 fails: FAIL
    • Element.afterbegin: createParserOptions returning "foo" fails: FAIL
    • Element.beforeend: createParserOptions can inject a sanitizer config: FAIL
    • Element.beforeend: createParserOptions can inject a sanitizer: FAIL
    • Element.beforeend: createParserOptions can override a sanitizer config: FAIL
    • Element.beforeend: createParserOptions returning 0 fails: FAIL
    • Element.beforeend: createParserOptions returning 123 fails: FAIL
    • Element.beforeend: createParserOptions returning "foo" fails: FAIL
    • Element.beforebegin: createParserOptions can inject a sanitizer config: FAIL
    • Element.beforebegin: createParserOptions can inject a sanitizer: FAIL
    • Element.beforebegin: createParserOptions can override a sanitizer config: FAIL
    • Element.beforebegin: createParserOptions returning 0 fails: FAIL
    • Element.beforebegin: createParserOptions returning 123 fails: FAIL
    • Element.beforebegin: createParserOptions returning "foo" fails: FAIL
    • Element.afterend: createParserOptions can inject a sanitizer config: FAIL
    • Element.afterend: createParserOptions can inject a sanitizer: FAIL
    • Element.afterend: createParserOptions can override a sanitizer config: FAIL
    • Element.afterend: createParserOptions returning 0 fails: FAIL
    • Element.afterend: createParserOptions returning 123 fails: FAIL
    • Element.afterend: createParserOptions returning "foo" fails: FAIL
    • Element.parseHTMLUnsafe: createParserOptions can inject a sanitizer config: FAIL
    • Element.parseHTMLUnsafe: createParserOptions can inject a sanitizer: FAIL
    • Element.parseHTMLUnsafe: createParserOptions can override a sanitizer config: FAIL
    • Element.parseHTMLUnsafe: createParserOptions can remove a sanitizer: FAIL
    • Element.parseHTMLUnsafe: createParserOptions returning 0 fails: FAIL
    • Element.parseHTMLUnsafe: createParserOptions returning 123 fails: FAIL
    • Element.parseHTMLUnsafe: createParserOptions returning "foo" fails: FAIL
    • Element: createContextualFragment with createParserOptions(runScripts=false) does not run scripts: FAIL
    • Element.setHTMLUnsafe: createParserOptions with sanitizer prevents createHTML from running: FAIL
    • Element.setHTMLUnsafe: exception in createParserOptions is rethrown and prevents createHTML: FAIL
    • Element.setHTMLUnsafe: exception in createHTML happens after createParserOptions runs: FAIL
    • Element.innerHTML: exception in createParserOptions is rethrown and prevents createHTML: FAIL
    • Element.innerHTML: exception in createHTML happens after createParserOptions runs: FAIL
    • Element.outerHTML: exception in createParserOptions is rethrown and prevents createHTML: FAIL
    • Element.outerHTML: exception in createHTML happens after createParserOptions runs: FAIL
    • Element.createContextualFragment: exception in createParserOptions is rethrown and prevents createHTML: FAIL
    • Element.createContextualFragment: exception in createHTML happens after createParserOptions runs: FAIL
    • Element.afterbegin: exception in createParserOptions is rethrown and prevents createHTML: FAIL
    • Element.afterbegin: exception in createHTML happens after createParserOptions runs: FAIL
    • Element.beforeend: exception in createParserOptions is rethrown and prevents createHTML: FAIL
    • Element.beforeend: exception in createHTML happens after createParserOptions runs: FAIL
    • Element.beforebegin: exception in createParserOptions is rethrown and prevents createHTML: FAIL
    • Element.beforebegin: exception in createHTML happens after createParserOptions runs: FAIL
    • Element.afterend: exception in createParserOptions is rethrown and prevents createHTML: FAIL
    • Element.afterend: exception in createHTML happens after createParserOptions runs: FAIL
  • /sanitizer-api/sethtml-xml-document-sanitizer.tentative.html [wpt.fyi]
    • innerHTML on XML document throws TypeError if default policy provides a sanitizer: FAIL
    • outerHTML on XML document throws TypeError if default policy provides a sanitizer: FAIL
    • insertAdjacentHTML on XML document throws TypeError if default policy provides a sanitizer: FAIL
    • createContextualFragment on XML document throws TypeError if default policy provides a sanitizer: FAIL
    • innerHTML on XML document created by DOMParser throws TypeError if default policy provides a sanitizer: FAIL
    • innerHTML on XML document from XHR response throws TypeError if default policy provides a sanitizer: FAIL
  • /sanitizer-api/sethtml-xml-document.html [wpt.fyi]
    • Testcase #0, shadow inside xmlDoc, shadowroot.setHTML("Hello!"): FAIL
    • Testcase #1, shadow inside xmlDoc, shadowroot.setHTML("<br>"): FAIL
    • Testcase #2, shadow inside xmlDoc, shadowroot.setHTML("<p>Hi</p>"): FAIL
    • Testcase #3, shadow inside xmlDoc, shadowroot.setHTML("<iframe></iframe><p>text</p>"): FAIL
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
You need to log in before you can comment on or make changes to this bug.