--- title: "Reverse Tab Nabbing" section: "Web Pentesting" sectionSlug: "pentesting-web" sourcePath: "src/pentesting-web/reverse-tab-nabbing.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/pentesting-web/reverse-tab-nabbing.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0" --- # Reverse Tab Nabbing ## Description If an attacker controls the `href` of a link opened with `target="_blank"` and the new page receives an opener reference, the attacker-controlled page can navigate the original tab through `window.opener`. Explicit `rel="opener"` requests that relationship. Current HTML behavior gives `_blank` links implicit `noopener` in modern browsers, but older browsers, embedded webviews, `window.open()` calls, or explicit `opener` can still expose it.[[1]](#references)[[3]](#references) A regular way to abuse this behaviour would be to **change the location of the original web** via `window.opener.location = https://attacker.com/victim.html` to a web controlled by the attacker that **looks like the original one**, so it can **imitate** the **login** **form** of the original website and ask for credentials to the user. Cross-origin policy does not give the malicious page arbitrary DOM or JavaScript access to the opener. It exposes only the limited cross-origin `WindowProxy` surface, whose most important tabnabbing capability is navigation of the opener.[[3]](#references) ## Overview ### With back link Link between parent and child pages when prevention attribute is not used:  ### Without back link Link between parent and child pages when prevention attribute is used:  ### Examples Create the following pages in a folder and run a web server with `python3 -m http.server`\ Then access `http://127.0.0.1:8000/vulnerable.html`, click the link, and observe that the original tab's URL changes. ```html