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

Maybe remove plugin enforcement from Trusted Types?

Open shhnjk opened this issue 4 years ago • 11 comments
trafficstars

As Flash and PNaCl went away, I don't see other way of embedding plugins which would cause DOM-XSS or equivalent. While I do see Adobe PDF as another threat, I'm not sure modern browser which supports Trusted Types would allow loading such a plugins. See also https://github.com/w3c/webappsec-csp/pull/456

shhnjk avatar Jan 19 '21 23:01 shhnjk

Sounds like it's the time to do it, yes. See also #234.

// cc @mikewest - Are plugins really, really going away?

koto avatar Jan 20 '21 07:01 koto

Flash is certainly gone. PDF isn't (and I think extensions still support NaCL modules? And possibly something something enterprise policy?). We're in the process of removing plugin-types from CSP, but I don't think there's good reason to remove object-src yet, given that <embed> and <object> can certainly still cause code execution.

mikewest avatar Jan 20 '21 08:01 mikewest

I think extensions still support NaCL modules?

Extensions are not an issue. Content scripts can bypass the Trusted Types anyways.

given that <embed> and <object> can certainly still cause code execution.

Causing JS execution isn't an issue, as long as it can't cause a JS execution in the context of the embedder (i.e. parent frame).

shhnjk avatar Jan 20 '21 08:01 shhnjk

I think Mike was talking about extensions that want to use TT to prevent DOM XSS in their own code.

koto avatar Jan 20 '21 08:01 koto

Okay, fair :) TT isn't supported in Extensions yet, and I'm waiting for it :)

shhnjk avatar Jan 20 '21 08:01 shhnjk

Why isn't TT supported in extensions? That sounds strange.

mikewest avatar Jan 20 '21 08:01 mikewest

Why isn't TT supported in extensions? That sounds strange.

There is at least an additional sink available in extension pages (i.e. chrome.tabs.executeScript) which needs to be guarded by TT (which isn't yet implemented). I'm waiting for that to be implemented (see this bug) :)

shhnjk avatar Jan 20 '21 21:01 shhnjk

Revisiting that; It sounds to me like we should keep the object/embed enforcement for now, as at least we should also make TT a viable solution for the browser extensions. The cost of keeping that is entirely on the IDL layer (https://w3c.github.io/trusted-types/dist/spec/#enforcement-in-sinks) so it's quite small. Whether Chromium implements the TT check in non-web extension API seems unrelated?

koto avatar Jan 19 '24 12:01 koto

Browser extensions are somewhat explicitly out-of-scope of web platform specifications though. So I don't think that conclusion follows.

annevk avatar Jan 19 '24 12:01 annevk

Fair point. Do I get it right, @annevk that you'd rather object and embed were removed altogether from TT enforcement? Nowadays, for web, they are closer to iframe, which we don't control with TT -- but I want to make sure I'm not misinterpreting.

koto avatar Jan 19 '24 14:01 koto

They are a bit different request-wise, but I'm not sure how much that plays into TT's threat model. I mainly don't want us to make a decision for these elements based on browser extensions.

annevk avatar Jan 20 '24 08:01 annevk

This came back up on my PR to upstream the IDL changes to HTML. If the threat caused by these sinks no longer exists (flash) then I think it makes sense to remove the TT coverage on them?

lukewarlow avatar Mar 15 '24 14:03 lukewarlow

+1, we should remove these.

koto avatar Mar 26 '24 16:03 koto