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.

SeverityLow
CVSS 3.13.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.02.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
CWECWE-1022: Use of Web Link to Untrusted Target with window.opener Access
OWASP Top 10A06:2025 Insecure Design
CategoryInput 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, or rel="noopener noreferrer" where the destination should not receive the Referer header, and remove rel="opener" unless an integration genuinely needs it. Apply this automatically to user-supplied links when they are rendered.
  • Pass noopener in the features argument of window.open(), or set the new window's opener property to null before navigating it.
  • Send the Cross-Origin-Opener-Policy: same-origin header, 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.
<a href="https://www.example.com/" target="_blank" rel="noopener noreferrer">...</a> window.open(url, "_blank", "noopener"); Cross-Origin-Opener-Policy: same-origin

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 trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Web Applications Findings

Every Web Applications finding