Founder's blog

Target="_blank" - the most underestimated vulnerability ever

May 4 2016 :: by Alex

People using target='_blank' links usually have no idea about this curious fact:

The page we're linking to gains partial access to the linking page via the window.opener object.

The newly opened tab can, say, change the window.opener.location to some phishing page. Or execute some JavaScript on the opener-page on your behalf... Users trust the page that is already opened, they won't get suspicious.

Example attack: create a fake "viral" page with cute cat pictures, jokes or whatever, get it shared on Facebook (which is known for opening links via _blank) and every time someone clicks the link - execute

window.opener.location = 'https://fakewebsite/';
…redirecting to a page that asks the user to re-enter her Facebook password.

How to fix

Add this to your outgoing links.


Update: FF does not support "noopener" so add this.

rel="noopener noreferrer"

Remember, that every time you open a new window via; you're also "vulnerable" to this, so always reset the "opener" property

var newWnd =;
newWnd.opener = null;

PS. Interestingly, Google doesn't seem to care.

'Target="_blank" - the most underestimated vulnerability ever' was written by Alex by Alex. CEO, founder