trusted-types icon indicating copy to clipboard operation
trusted-types copied to clipboard

Add tests for getAttributeType()/getPropertyType() for embed@src, object@codebase and object@data

Open fred-wang opened this issue 1 year ago • 4 comments

cc @mbrodesser-Igalia @lukewarlow @smaug---- @koto

It seems chromium treats embed's src attribute and object's codebase/data attributes as TrustedScriptURL:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.cc;l=50;drc=08efa89c7d73d72e6ebcddbf053c41a230dc1ba8?q=TrustedTypePolicyFactory

But they are not listed in the spec: https://w3c.github.io/trusted-types/dist/spec/#abstract-opdef-get-trusted-type-data-for-attribute

AFAIK, there is no WPT tests for these attributes either.

fred-wang avatar Oct 22 '24 13:10 fred-wang

They were historically included but no longer are. Chromium needs to update it's implementation such that they're no longer protected. It might be worth adding a test that ensured that they're not covered by TT.

lukewarlow avatar Oct 22 '24 13:10 lukewarlow

Same for the properties:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.cc;drc=08efa89c7d73d72e6ebcddbf053c41a230dc1ba8;l=92?q=TrustedTypePolicyFactory

fred-wang avatar Oct 22 '24 13:10 fred-wang

They were historically included but no longer are. Chromium needs to update it's implementation such that they're no longer protected. It might be worth adding a test that ensured that they're not covered by TT.

Thanks Luke. Will add tests for that then!

fred-wang avatar Oct 22 '24 13:10 fred-wang

Per Luke's comment, no spec changes are needed, so changing title to indicate this is only about tests.

I've opened https://github.com/web-platform-tests/wpt/pull/48760 for that.

fred-wang avatar Oct 23 '24 09:10 fred-wang

For context, these were removed from the spec in https://github.com/w3c/trusted-types/issues/305. @otherdaniel, we should correct the Chromium impl and remove the enforcement.

koto avatar Oct 31 '24 09:10 koto

This is the Chromium issue: https://issues.chromium.org/issues/375219958

https://github.com/web-platform-tests/wpt/pull/48760 landed, so I believe we can close this.

fred-wang avatar Oct 31 '24 09:10 fred-wang