by Blank Blake Dietz
var w = window.open("https://foo.com");
/**
* This is executed from document B, so window is document B's global name space.
* window.opener is a reference to document A.
*/
if (window.opener) {
// Here is where document B accesses document A
window.opener.location = "https://f00.com";
}
<a href="http://www.foo.com" rel="noopener" target="_blank">Hello click me</a>
<a href="https://www.foo.com" rel="noopener noreferrer" target="_blank">Hello click me</a>
var w = window.open("https://foo.com", , "noopener noreferrer");
Unfortunately, we believe that this class of attacks is inherent to the current design of web browsers and can't be meaningfully mitigated by any single website; in particular, clobbering the window.opener property limits one of the vectors, but still makes it easy to exploit the remaining ones.