Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test coverage of sink values #494

Open
lukewarlow opened this issue Mar 28, 2024 · 6 comments
Open

Improve test coverage of sink values #494

lukewarlow opened this issue Mar 28, 2024 · 6 comments
Milestone

Comments

@lukewarlow
Copy link
Member

We should ensure that we have exhaustive coverage of the "sink" value, this is the prefix for violation object samples, aswell as being one of the arguments for the default policy.

@lukewarlow
Copy link
Member Author

Example change web-platform-tests/wpt#45058

@lukewarlow lukewarlow added this to the v1 milestone Mar 28, 2024
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Dec 18, 2024
One step towards fixing w3c/trusted-types#494.

Differential Revision: https://phabricator.services.mozilla.com/D232363

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1907849
gecko-commit: cb3e58c8b7ff8d78bfab512fae053cc7de5d787b
gecko-reviewers: smaug
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Dec 18, 2024
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this issue Dec 19, 2024
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Dec 30, 2024
One step towards fixing w3c/trusted-types#494.

Differential Revision: https://phabricator.services.mozilla.com/D232363

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1907849
gecko-commit: c006cb26e155686ac4c27d2a0797ff2ce03e39a8
gecko-reviewers: smaug
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Dec 30, 2024
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Dec 31, 2024
One step towards fixing w3c/trusted-types#494.

Differential Revision: https://phabricator.services.mozilla.com/D232363

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1907849
gecko-commit: c006cb26e155686ac4c27d2a0797ff2ce03e39a8
gecko-reviewers: smaug
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Jan 1, 2025
…eHTMLUnsafe". r=smaug

One step towards fixing w3c/trusted-types#494.

Differential Revision: https://phabricator.services.mozilla.com/D232363

UltraBlame original commit: cb3e58c8b7ff8d78bfab512fae053cc7de5d787b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Jan 1, 2025
…eHTMLUnsafe". r=smaug

One step towards fixing w3c/trusted-types#494.

Differential Revision: https://phabricator.services.mozilla.com/D232363

UltraBlame original commit: c006cb26e155686ac4c27d2a0797ff2ce03e39a8
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Jan 1, 2025
…eHTMLUnsafe". r=smaug

One step towards fixing w3c/trusted-types#494.

Differential Revision: https://phabricator.services.mozilla.com/D232363

UltraBlame original commit: cb3e58c8b7ff8d78bfab512fae053cc7de5d787b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Jan 1, 2025
…eHTMLUnsafe". r=smaug

One step towards fixing w3c/trusted-types#494.

Differential Revision: https://phabricator.services.mozilla.com/D232363

UltraBlame original commit: c006cb26e155686ac4c27d2a0797ff2ce03e39a8
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Jan 1, 2025
…eHTMLUnsafe". r=smaug

One step towards fixing w3c/trusted-types#494.

Differential Revision: https://phabricator.services.mozilla.com/D232363

UltraBlame original commit: cb3e58c8b7ff8d78bfab512fae053cc7de5d787b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Jan 1, 2025
…eHTMLUnsafe". r=smaug

One step towards fixing w3c/trusted-types#494.

Differential Revision: https://phabricator.services.mozilla.com/D232363

UltraBlame original commit: c006cb26e155686ac4c27d2a0797ff2ce03e39a8
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this issue Jan 2, 2025
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this issue Jan 2, 2025
@fred-wang
Copy link
Collaborator

fred-wang commented Jan 3, 2025

@fred-wang
Copy link
Collaborator

fred-wang commented Jan 6, 2025

Trusted Types spec:

  • HTMLScriptElement's innerText (TrustedScript)
  • HTMLScriptElement's textContent (TrustedScript)
  • HTMLScriptElement's src (TrustedScriptURL)
  • HTMLScriptElement's text (TrustedScript)

HTML spec:

  • Document's write() (TrustedHTML)
  • Document's writeln() (TrustedHTML)
  • Document's parseHTMLUnsafe() (TrustedHTML)
  • HTMLIFrameElement's srcdoc (TrustedHTML)
  • Document's setHTMLUnsafe()̀ (TrustedHTML`)
  • Element's innerHTML (TrustedHTML)
  • Element's outerHTML (TrustedHTML)
  • Element's insertAdjacentHTML() (TrustedHTML)
  • ShadowRoot's setHTMLUnsafe() (TrustedHTML)
  • ShadowRoot's innerHTML (TrustedHTML)
  • DOMParser's parseFromString()̀ (TrustedHTML`)
  • Range's createContextualFragment() (TrustedHTML)
  • eval() (TrustedScript)
  • WindowOrWorkerGlobalScope's setTimeout() (TrustedScript)
  • WindowOrWorkerGlobalScope's setInterval() (TrustedScript)
  • WorkerGlobalScope's importScripts() (TrustedScriptURL)
  • Worker's constructor (TrustedScriptURL)
  • SharedWorker's constructor (TrustedScriptURL)

DOM spec:

  • Element's setAttribute() (TrustedType)
  • Element's setAttributeNS() (TrustedType)

CSP spec:

  • eval() (TrustedScript)
  • function constructor (TrustedScript)

SVG spec:

  • SVGAnimatedString's baseVal (TrustedScriptURL) -- this seems essentially used for SVGScriptElement's href, but the spec status is a bit fuzzy.
  • Luke mentioned SVGScriptElement should have similar script enforcement as HTML, but details are not specced yet. See SVGScriptElement needs TT protection too #483

Service Workers spec:

  • ServiceWorkerContainer's register() (TrustedScriptURL)

execCommand draft:

  • Document's execCommand() (TrustedHTML)

@lukewarlow
Copy link
Member Author

There's also SVGScriptElement which needs handling it's just not specced yet

@fred-wang
Copy link
Collaborator

@lukewarlow yes I noticed that. It seems some PRs have been merged but are still not public. will follow-up with you privately

fred-wang added a commit to web-platform-tests/wpt that referenced this issue Jan 6, 2025
This verifies some API for ParentNode/ChildNode [1] [2] don't do any
check for trusted types. This might already be covered by IDL tests but
we just perform a direct verification here. This test fails in Chromium,
which is not aligned with the DOM spec here [3] and performs specific
checks for HTML script elements. Chromium also implements similar
behavior for `ChildNodePart.replaceChildren()` but that's currently not
shipped [4].

[1] https://dom.spec.whatwg.org/#interface-parentnode
[2] https://dom.spec.whatwg.org/#interface-childnode
[3] w3c/trusted-types#494 (comment)
[4] https://groups.google.com/a/chromium.org/g/blink-dev/c/wIADRnljZDA/m/whzEaaAADAAJ
fred-wang added a commit to web-platform-tests/wpt that referenced this issue Jan 6, 2025
…49920)

This verifies some API for ParentNode/ChildNode [1] [2] don't do any
check for trusted types. This might already be covered by IDL tests but
we just perform a direct verification here. This test fails in Chromium,
which is not aligned with the DOM spec here [3] and performs specific
checks for HTML script elements. Chromium also implements similar
behavior for `ChildNodePart.replaceChildren()` but that's currently not
shipped [4].

[1] https://dom.spec.whatwg.org/#interface-parentnode
[2] https://dom.spec.whatwg.org/#interface-childnode
[3] w3c/trusted-types#494 (comment)
[4] https://groups.google.com/a/chromium.org/g/blink-dev/c/wIADRnljZDA/m/whzEaaAADAAJ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants