-
Notifications
You must be signed in to change notification settings - Fork 74
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 for DOM integration in WPT #425
Improve test coverage for DOM integration in WPT #425
Comments
web-platform-tests/wpt#44266 - PR to add coverage for setHTMLUnsafe and parseHTMLUnsafe |
@koto AFAIK, such attribute nodes can only be gotten from a different realm, if the realm corresponds to the same origin. E.g. via an "Prevent malicious authors of the web application’s JavaScript code from being able to bypass the restrictions; attempting to protect against malicious authors would result in an overly complex and not-practical design." Is the assumption that same-origin documents may correspond to multiple authors, from which only one may be malicious? |
It's only testing the mechanics of the DOM integration. We have to pick a realm to run the TT checks against, and this is a way to test that we're picking the element's document realm. We're not extending the threat model to cover cross-documents vector, the fact that it might be used to block attaching foreign (same-origin) attribute node to a local element is just a consequence of the mechanisms we chose. |
…to a TT iframe element throws First step to fix <w3c/trusted-types#425>. Will add separate commits for the other tests requested at above ticket.
@koto: to be precise, the test should be added to a file like <block-string-assignment-to-Element-setAttributeNode.html>, since |
Yes |
…s created in a non-TT enforcing realm are imported to a TT-enforcing realm See <https://w3c.github.io/trusted-types/dist/spec/#validate-attribute-mutation>. This excludes tests for <https://w3c.github.io/trusted-types/dist/spec/#enforcement-in-event-handler-content-attributes> which will have to be added once that part of the spec is propagated to the HTML spec. The remaining tests mentioned at <w3c/trusted-types#425 (comment)> will be added in separate commits.
…to a TT iframe element throws First step to fix <w3c/trusted-types#425>. Will add separate commits for the other tests requested at above ticket.
…s created in a non-TT enforcing realm are imported to a TT-enforcing realm See <https://w3c.github.io/trusted-types/dist/spec/#validate-attribute-mutation>. This excludes tests for <https://w3c.github.io/trusted-types/dist/spec/#enforcement-in-event-handler-content-attributes> which will have to be added once that part of the spec is propagated to the HTML spec. The remaining tests mentioned at <w3c/trusted-types#425 (comment)> will be added in separate commits.
…n `setAttribute` is called As requested in <w3c/trusted-types#425 (comment)>.
…to a TT iframe element throws First step to fix <w3c/trusted-types#425>. Will add separate commits for the other tests requested at above ticket.
…s created in a non-TT enforcing realm are imported to a TT-enforcing realm See <https://w3c.github.io/trusted-types/dist/spec/#validate-attribute-mutation>. This excludes tests for <https://w3c.github.io/trusted-types/dist/spec/#enforcement-in-event-handler-content-attributes> which will have to be added once that part of the spec is propagated to the HTML spec. The remaining tests mentioned at <w3c/trusted-types#425 (comment)> will be added in separate commits.
…t policy value when `setAttribute` is called (#44673) * Move some test input data from the test to the input data * Add test that mutation observers receive the default policy value when `setAttribute` is called As requested in <w3c/trusted-types#425 (comment)>.
Reopening until web-platform-tests/wpt#44323 is merged. |
… for `setAttributeNS` to `null`, a=testonly Automatic update from web-platform-tests Change namespace for Trusted-Types tests for `setAttributeNS` to `null` See <w3c/trusted-types#418 (comment)> and <w3c/trusted-types#418 (comment)>. Preparation to fix <w3c/trusted-types#425>. -- wpt-commits: f823803bb10d628a2b09a3e76b602c9d9f7866b9 wpt-pr: 44699
… observers receive the default policy value when `setAttribute` is called, a=testonly Automatic update from web-platform-tests Add test for Trusted Types that mutation observers receive the default policy value when `setAttribute` is called (#44673) * Move some test input data from the test to the input data * Add test that mutation observers receive the default policy value when `setAttribute` is called As requested in <w3c/trusted-types#425 (comment)>. -- wpt-commits: 33bdd2999338631492b8ce34a6a6c7ee48277c32 wpt-pr: 44673
… for `setAttributeNS` to `null`, a=testonly Automatic update from web-platform-tests Change namespace for Trusted-Types tests for `setAttributeNS` to `null` See <w3c/trusted-types#418 (comment)> and <w3c/trusted-types#418 (comment)>. Preparation to fix <w3c/trusted-types#425>. -- wpt-commits: f823803bb10d628a2b09a3e76b602c9d9f7866b9 wpt-pr: 44699
… observers receive the default policy value when `setAttribute` is called, a=testonly Automatic update from web-platform-tests Add test for Trusted Types that mutation observers receive the default policy value when `setAttribute` is called (#44673) * Move some test input data from the test to the input data * Add test that mutation observers receive the default policy value when `setAttribute` is called As requested in <w3c/trusted-types#425 (comment)>. -- wpt-commits: 33bdd2999338631492b8ce34a6a6c7ee48277c32 wpt-pr: 44673
…t policy value when `setAttribute` is called (web-platform-tests#44673) * Move some test input data from the test to the input data * Add test that mutation observers receive the default policy value when `setAttribute` is called As requested in <w3c/trusted-types#425 (comment)>.
…to a TT iframe element throws First step to fix <w3c/trusted-types#425>. Will add separate commits for the other tests requested at above ticket.
…s created in a non-TT enforcing realm are imported to a TT-enforcing realm See <https://w3c.github.io/trusted-types/dist/spec/#validate-attribute-mutation>. This excludes tests for <https://w3c.github.io/trusted-types/dist/spec/#enforcement-in-event-handler-content-attributes> which will have to be added once that part of the spec is propagated to the HTML spec. The remaining tests mentioned at <w3c/trusted-types#425 (comment)> will be added in separate commits.
…to a TT iframe element throws First step to fix <w3c/trusted-types#425>. Will add separate commits for the other tests requested at above ticket.
…s created in a non-TT enforcing realm are imported to a TT-enforcing realm See <https://w3c.github.io/trusted-types/dist/spec/#validate-attribute-mutation>. This excludes tests for <https://w3c.github.io/trusted-types/dist/spec/#enforcement-in-event-handler-content-attributes> which will have to be added once that part of the spec is propagated to the HTML spec. The remaining tests mentioned at <w3c/trusted-types#425 (comment)> will be added in separate commits.
An additional test for web-platform-tests/wpt#44323 (review) is required. |
Reopening to address #425 (comment). |
…ute node from a non-TT realm to a TT iframe element throws, a=testonly Automatic update from web-platform-tests Trusted Types: check that the policy is obtained from the correct global Helps with w3c/trusted-types#425. -- wpt-commits: 560c8d6dc55b08d13ba88f48bd51828bfbce8abd wpt-pr: 44323
…ute node from a non-TT realm to a TT iframe element throws, a=testonly Automatic update from web-platform-tests Trusted Types: check that the policy is obtained from the correct global Helps with w3c/trusted-types#425. -- wpt-commits: 560c8d6dc55b08d13ba88f48bd51828bfbce8abd wpt-pr: 44323
… non-TT realm. See discussions at w3c/trusted-types#425 (comment).
… non-TT realm. See discussions at w3c/trusted-types#425 (comment).
… non-TT realm. See discussions at w3c/trusted-types#425 (comment).
… non-TT realm. See discussions at w3c/trusted-types#425 (comment).
With https://phabricator.services.mozilla.com/D231921 all scenarios are now covered. |
https://wpt.fyi/results/trusted-types/block-string-assignment-to-Element-setAttribute.html needs
srcdoc
) node created in a different realm. It should be rejected when imported and added to an iframe in the current, TT-enforcing realm.MutationObserver
https://jsfiddle.net/014ze36t/2/https://wpt.fyi/results/trusted-types/block-string-assignment-to-Element-setAttributeNS.html needs
iframe.setAttributeNS(null, 'SrcDoc')
attribute (or a similar mixed-case test for HTML's attributes).#418 (comment) and #418 (comment) for context.
The text was updated successfully, but these errors were encountered: