Tabnabbing
Tabnabbing (reverse tabnabbing) allows an attacker-controlled page to rewrite the content of a parent page, typically replacing it with a phishing site.
How It Works
Victim clicks a link that opens in a new tab (
target="_blank")The new page has access to
window.opener(the original page)Attacker's page executes:
window.opener.location = "https://phishing-site.com"Original tab silently redirects to phishing site
Victim returns to original tab, sees fake login, enters credentials
Vulnerable Code Pattern
<!-- VULNERABLE: No rel attribute -->
<a href="https://attacker.com" target="_blank">Click me</a>
<!-- VULNERABLE: Empty rel attribute -->
<a href="https://attacker.com" target="_blank" rel="">Click me</a>
<!-- VULNERABLE: Only noreferrer (still allows opener access in some browsers) -->
<a href="https://attacker.com" target="_blank" rel="noreferrer">Click me</a>Secure Code Pattern
Detection
Manual Testing
Automated Scanning
Exploitation
Basic Attack Page
Phishing Page
Delayed Attack (More Stealthy)
Attack Scenarios
Forum posts
User-submitted links with target="_blank"
Comments
Blog/article comment sections
User profiles
Profile links to external sites
Documentation
Links to external resources
Email links
Webmail rendering links
Browser Behavior
Chrome 88+
Implicitly adds noopener
Firefox 79+
Implicitly adds noopener
Safari 12.1+
Implicitly adds noopener
Edge 88+
Implicitly adds noopener
Note: While modern browsers add implicit protection, explicit
rel="noopener"is still recommended for older browser support and code clarity.
window.open() Vulnerability
Related Topics
Last updated
Was this helpful?