Open bahrus opened 1 year ago
I can't think of how this is introducing any new attack vectors* off the top of my head?
Having said that it's definitely something that'd be good to get more thoughts on.
*
Aside from the full screen action which would be a new capability when JS is disabled. That one potentially needs some thought put into it.
https://demo.lukewarlow.dev/fullscreen/ - These two iframes demonstrate a potential new security risk of the fullscreen actions within a sandboxed iframe.
Currently fullscreen API requires javascript so a sandbox without "allow-scripts" won't be able to do go fullscreen. Where as with invoketargets they don't need this.
There's various potential mitigations for this if we want to, ranging from requiring scripts when it's in a sandboxed frame, to blocking these actions within an iframe entirely.
cc @keithamus
"Would these attributes be subject to CSP, sandboxing or specific HTML sanitizer behaviour at all?" - a question raised in the Mozilla I2P.
This is an interesting question, and one that was (kind of) raised for the popover popovertarget
attribute: https://github.com/whatwg/html/issues/4633#issuecomment-733785375. The concern there was that the popover feature allowed a declarative way to put content on top of the page, which was previously only possible via javascript (requestFullscreen
).
I'm still not sure "no-JS" implies strong guarantees about rendering or even state changes like expanding or closing a <details>
element. If user-provided HTML needs to be rendered, sanitizers must be present and well-configured to strip out anything not explicitly on an allow-list. The new invoketarget
and interesttarget
attributes should not be on that allow-list. (And if the sanitizer is only using a deny-list, then it's already broken.)
The one place where it does seem like CSP/sandboxing should apply is iframes. But shouldn't existing scripting protections keep someone from connecting an invoker in one frame to an invokee in another frame? That can't be done with idrefs. I don't quite understand the iframe attack vector.
The Open UI Community Group just discussed [Invokers] Security implications?
, and agreed to the following:
RESOLVED: Proposed resolution: We consider the current implementations to be sufficiently secure (details of which will be shared on the whatwg issue).
Please see https://github.com/openui/open-ui/pull/942 which goes into some detail around the security considerations of the proposal.
There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.
This seems like a great idea. The only concern I have is if there are any security implications? It doesn't seem out of line with other attributes (like specifying the target for a form), but I wonder if this should be an attribute that is stripped from HTML Sanitizing algorithms by default? Or maybe not?