Gitlab.com is still vulnerable to reverse tabnabbing
GitLab's link sanitisation failed to add rel="nofollow noreferrer noopener" to certain external anchor links, such as those using a userinfo trick. An attacker could exploit this to perform reverse tabnabbing, potentially redirecting a victim's opened tab to a malicious site.
GitLab
Originally disclosed on GitLab
- Fixed in 15 months
- Disclosed after 15 months
HackerOne report #1019578 by kkp_hackk9 on 2020-10-27, assigned to @rchan-gitlab:
Report | How To Reproduce
Report
Gitlab.com is still vulnerable to reverse tabnabbing
Summary
Gitlab.com is still vulnerable to reverse tabnabbing in milestones, tags, issues, comments, etc. I am able to bypass the fix we have made for below reported issues.
- https://hackerone.com/reports/212629
- https://hackerone.com/reports/211065
- https://hackerone.com/reports/213114
I think we still should have implemented proper parsing mechanism to add rel="nofollow noreferrer noopener" in links.
POC payload
<a target="_blank" href="http:evil.com">Reverse Tabnabbing</a>
Steps to reproduce
- Add above mentioned payload in any milestone, tag or comments and save it.
- Inspect it in DOM, rel="nofollow noreferrer noopener" would be missing for this particular payload. It would render as it is.
- So in the example above the victim ends up on evil.com, which is where the same scenario as https://hackerone.com/reports/211065 can be performed.
Impact
Please note that impact here is pretty high as here attacker can easily able to exploit this on gitlab anywhere where HTML can be added.
Victim ends up being exploited by reverse tabnabbing
What is the current bug behavior?
Currently due to lack of proper parsing mechanism for external links, for above mentioned case rel="nofollow noreferrer noopener" is missing for external anchor links, user can be exploited by reverse tabnabbing.
Why does this vulnerability exist?
By creating a link with https://[email protected] the parser ignores it and does not add the usual rel="nofollow noreferrer" which is located on all other links. I noticed this while performing different attack vectors.
What is the expected correct behavior?
Improvement in parsing mechanism to include rel="nofollow noreferrer noopener" in all external anchor links.
Please ping me if anything is unclear.
Impact
Please note that impact here is pretty high as here attacker can easily able to exploit this on gitlab anywhere where HTML can be added.
Victim ends up being exploited by reverse tabnabbing
How To Reproduce
Please add reproducibility information to this section:
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 link parser failed to recognise certain external link formats and therefore did not add the rel="nofollow noreferrer noopener" attributes.
Impact
An attacker could exploit this wherever HTML can be added on GitLab, and the victim ends up being exploited by reverse tabnabbing.
What the attacker needed
Ability to add HTML in milestones, tags, issues, or comments; victim clicks the crafted link
The fix
The parsing mechanism should be improved to include rel="nofollow noreferrer noopener" in all external anchor links.
How it was found
- Add the payload to any milestone, tag, or comment and save it.
- Inspect the rendered link in the DOM and observe that the rel attributes are missing.
- The victim is then taken to the attacker's site, where reverse tabnabbing can occur.
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 you click a link that opens in a new tab, the new page can sometimes control the original page through a browser feature called window.opener. Reverse tabnabbing is when a malicious new page uses that control to change the original page, for example to a fake login form. This report says GitLab did not properly block that control on some links.
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.