Reverse Tabnabbing
A page opened from the application in a new tab keeps a reference to the original tab, so a malicious page can silently replace it with a phishing page.
| Severity | Low |
| CVSS 3.1 | 3.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N Open in the calculator |
| CVSS 4.0 | 2.1 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-1022: Use of Web Link to Untrusted Target with window.opener Access |
| OWASP Top 10 | A06:2025 Insecure Design |
| Category | Input Validation |
Description
When a page opens another page in a new tab or window, the browser can give the new page a reference to the original through window.opener. If the new page is cross-origin it cannot read the original, but it can still change its location.
A page under an attacker's control, reached from a link that users can post or from a compromised third-party site, can use this to redirect the original tab to a page of the attacker's choosing, most usefully a convincing copy of the application's sign-in page, while the user is looking at the new tab. When the user returns, they may sign in again on the fake page, and the attacker collects any credentials entered there. The attack depends on the user returning to the original tab without noticing that its address has changed, and it does not give the attacker access to the original page's content or session.
The opener reference is created by links with target="_blank" in older browsers, by links that also carry rel="opener", and by window.open() calls that do not pass noopener. Current versions of the major browsers treat target="_blank" links as if rel="noopener" were set, so the issue now arises mainly from window.open(), from explicit rel="opener", and from users on older browsers.
The weakness is identified by reviewing the page source and scripts for links and calls that open external or user-supplied addresses in a new tab without noopener, and can be confirmed with a test page that changes window.opener.location. Scanners often report the pattern as a low or informational issue.
Remediation
Remove the opener reference wherever the application opens another page:
- Add
rel="noopener"to every link that opens in a new tab, orrel="noopener noreferrer"where the destination should not receive theRefererheader, and removerel="opener"unless an integration genuinely needs it. Apply this automatically to user-supplied links when they are rendered. - Pass
noopenerin the features argument ofwindow.open(), or set the new window'sopenerproperty tonullbefore navigating it. - Send the
Cross-Origin-Opener-Policy: same-originheader, which places cross-origin pages opened from the application in a separate browsing context group with no reference back to it. Test it first, as it also breaks pop-up flows that depend on the opener, such as some payment and sign-in integrations.
Confirm the fix by repeating the test with the test page: window.opener should be null in every page opened from the application.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.