This vulnerability occurs when a web application links to an external, untrusted site without protecting its own window from being manipulated by that site. Specifically, it fails to prevent the external page from altering security-sensitive properties of the `window.opener` object, such as the page's location.
When a link with `target="_blank"` opens an external site in a new tab, the new page gains a reference back to the originating page via the `window.opener` object. If the external site is compromised or malicious, it can execute scripts that read or modify properties of the `window.opener` object. This cross-origin access allows an attacker to, for example, silently change the `location` property of your original page, redirecting it to a phishing site without the user's knowledge. Since the user's focus is on the newly opened tab, the original tab performing the redirect may not be visible. This makes the attack particularly stealthy, as users are unlikely to notice their original page has been hijacked until they return to it, potentially after entering sensitive information on a spoofed site.
Impact: Alter Execution Logic
The user may be redirected to an untrusted page that contains undesired content or malicious script code.
htmljavascripthtmljavascriptjavascriptMedium