Stored-XSS in merge requests
A stored cross-site scripting vulnerability existed in GitLab merge requests, where a branch name containing HTML could execute script. An attacker could run arbitrary actions on behalf of a victim who viewed the merge request.
ba5d2d132de8622c890dd60 Follow
Originally disclosed on HackerOne
- Disclosed after 5 days
Summary As an attacker I could do XSS on Web.com because it is vulnerable Stored XSS, also known as persistent XSS, is more damaging than non-persistent XSS. It occurs when a malicious script is injected directly into a vulnerable web application.
Steps to reproduce
- Go to https://gitlab.com/
- Create a new branch with name any of these
"><img src=x onerror=alert(document.domain)>
<iframe <><a href=javascript:alert(document.cookie)>Click Here</a>=></iframe> <iframe srcdoc="<img src=x onerror=alert(document.domain)>"></iframe>- Create a new merge request from the new branch to master
- XSS is saved and if you will open the readme file and add these payloads to it it will also save these payloads
Output of checks
This bug happens on GitLab.com
Impact
This stored-XSS allows attacker to execute arbitrary actions on behalf of victim notably via gitlab API. The attacker can steal data from whoever checks the report.
Attachments
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 branch name was inserted into the merge request page without proper HTML encoding or sanitisation.
Impact
An attacker could execute arbitrary actions on behalf of a victim, including via the GitLab API, and steal data from anyone who views the report.
What the attacker needed
A GitLab account; victim views the merge request
How it was found
- Go to GitLab.com.
- Create a new branch whose name contains HTML markup.
- Create a merge request from that branch to master.
- The XSS payload is saved in the merge request and readme.
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.
Cross-site scripting (XSS) is when a website displays user input as if it were part of the page, so a malicious script runs in a visitor's browser. Here, a branch name was shown without proper cleaning, so opening a merge request could run the attacker's script. That script could then act as the logged-in user.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.