411 points · by dmnd · 10y ago · 109 comments
... Why. Why would anyone (not maliciously) consider this desirable behaviour?
I doubt that many sites rely on this broken behavior. And even if they do, browsers could still block it and show some warning to the user "Hey, this tab that just opened wants to change the URL of this other tab [allow, always, nope, never]", just like they do for popup windows or sites with broken SSL certs.
Does someone with more experience in these kind of issues know why it was decided to put the responsibility of fixing this on individual websites (rel=noopener) instead of browsers (blocking the URL changing or showing a warning)?
Any web based system where a pop up dialog is opened to allow the user to select something that is then inserted into the original page?
For those systems, though, i'd imagine most of them would have these popup windows on the same origin, right? So having browsers prevent child windows changing their parent's location if they are cross-origin seems like a sensible idea, or am i missing something else?
Time to find Firefox's equivalent issue page and convince them not to follow the leader.
(Also, I'm not sure I've personally seen that)
Awesome work btw, it runs like greased lightning in FF nightly.
Unfortunately "let the user decide" is not the best answer if you want to link to something like "terms and conditions" in the middle of a sign up flow or something. If the user doesn't know how to open it in a new tab on their own, this can be extremely frustrating I'd imagine.
What is the correct way to stalk, hunt, kill, stuff and mount the user?
Answer: there is no correct way to do something which is fundamentally incorrect.
> Unfortunately "let the user decide" is not the best answer if you want to link to something like "terms and conditions" in the middle of a sign up flow or something. If the user doesn't know how to open it in a new tab on their own, this can be extremely frustrating I'd imagine.
Abusing my browser is extremely frustrating for me. If I want to open a link (a link, see, not some horrid piece of JavaScript) in a different tab, I middle-click and get on with life. You don't need to do that for me, any more than you need to offer me a typing widget when I have a perfectly functional keyboard, or fake a link when I have a browser perfectly capable of understand the <a> tag, or check my (correct) email address with an incorrect regular expression.
Please don't break the Internet.
Probably this is a result of the internet already being broken, since the worst of it is in infite-scrolling type things where my confidence that I can get back to where I was originally after going back is very, very low.
As described in the article, it is dangerous when the link's destination is not controlled by you. That destination has access to its opener's window and could potentially change the url to eg. a malicious look-alike of your site.
It's a consideration when linking to arbitrary pages, but when you own the destination (and trust that your site has no other security issues) then this becomes a non-issue.
Is there any internet user who doesn't know how to open in new tab? Just curious to what type of users they would be.
Not my problem anymore, but I never even considered this.
EDIT: 2013 to be exact.
https://bugs.chromium.org/p/chromium/issues/detail?id=168988
which links to another issue from 2012.
Edit: My purpose was to confirm the bug has been "known" for awhile, not to take away credit for you reporting the bug years ago. Congrats for independently discovering it before many people (such as myself) became aware of it.
For sure, I think its a very important bug that hasn't had much attention for years now, especially since so many websites use _blank, GMail being one of them.
Instead, the two links present two different angles to the same problem. The first link demonstrates the attack using a page within the same domain (reasonable), and the second demonstrates that it will continue to work even when the link points to a page ordinarily restricted by cross-origin policies (potentially surprising).
If you manually add `rel=noopener` to either link, the attack won't work. Try it with DevTools.
It could be worth checking out if you want to avoid experiencing this security issue yourself (but I offer no warranties) or if you want to see if it would break any site you visit if browsers would enable the behavior by default.
NoScript has its place, for example in the Tor browser or in other high-security applications, but it's too much of a burden for everyday use.
No it is not. It actually removes most of the burden from my daily browsing. Modern web is mostly a bunch of obstacles between the user and the information, and with NoScript (or xombrero in my case) the user skips over that. I believe most of the users don't care about layouts, transitions, syncing between tabs, etc, it's all designers' and marketers' caprice.
If you tools/framework make this hard or generate output that incompatible with progressive enhancement, then I suggest you find (or write) better tools.
[1] Being NoScript users, they most likely also run some sort of ad blocker, so ad revenue from them is likely zero.
As the browser I use, Opera 12, also treats all links manually opened in the new tab as if they had target="_blank", giving them opener access, I decided to remove the window.opener altogether by replacing the "opener" string with "opera" in the opera.dll. This way it gets overwritten by the normal window.opera variable and is essentially hidden. So far I haven't encountered a site legitimately relying on this behavior.
You want rel=noopener because the page it navigates to can't affect the content of the opening page.
IIRC.
The attacker can replace the current page with his own phising page.
Of course, the hostname part of the url would change, but the user is unlikely to notice that.