-
Notifications
You must be signed in to change notification settings - Fork 43
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
Prevent invocation from popup #64
Comments
In the tag review thread, @annevk says:
Do you mean only allow the text directive to invoke if the source link/script-context is in a popup window that was opened with rel=noopener? If so, I think might work. I wonder if we could do even simpler and better: in Navigating Across Documents we always have a source browsing context. We could only allow invoking the feature if That said, I think you're still vulnerable to something like this:
I think it's still worth doing since this adds another hurdle for a successful exploit but I'd also point out this alone isn't a vulnerability. An attacker still needs a user gesture and is still blocked by SOP from learning anything interesting about the target origin and a popup is more likely to alert a user to suspicious activity or be blocked. @annevk WDYT? |
A variant I had in mind is that you can only use this syntax with |
Do you mean that in all cases it should only invoke the text directive if the navigation came from an I think there's probably some useful cases for being able to navigate from script (e.g. building custom buttons/controls) but that's probably an ok tradeoff? I was worried an attacker could still use |
They could use |
Ok, that sounds like a reasonable restriction to me. Is there any existing terminology relating to this in the HTML spec I could leverage or should I spell it out explicitly? |
HTML has some noopener infrastructure already, see "The rules for choosing a browsing context" in particular. As I mentioned, we might have to add noopener support for |
Quick clarification:
By "the
Based on the above, does this mean that a And a somewhat tangential question based on the
By "this ought to fail" you mean activating the text directive, right? In the MDN page for
I see this behavior in Firefox; however, in Chrome, if you open a window with name and without I don't see where in the spec the MDN text comes from but it seems wrong that opening a link with 'noopener' can result in the target having |
Yeah, a new browsing context group. I don't think this should mean that history is lost (if so COOP could destroy history), but it likely requires changes to that code, yes.
Yes.
Unfortunately, yes. Firefox has an open bug. We want the same behavior for |
For security, we want to avoid invoking the text directive on windows that can be scripted by another origin. It was pointed out in w3ctag/design-reviews#392 (comment) that our current set of restrictions doesn't work in all cases, an attacker could:
:~:text
Since V is top-level and has no opener, origin A is now able to cause text directive invocations in V which is bad because it persists past the navigation.
The text was updated successfully, but these errors were encountered: