Skip to content
XSS Disclosed report Beginner

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

Informational View original
  • 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

  1. Go to https://gitlab.com/
  2. Create a new branch with name any of these
<form><button formaction=javascript&colon;alert(1)>CLICKME

"><img src=x onerror=alert(document.domain)>

<iframe <><a href=javascript&colon;alert(document.cookie)>Click Here</a>=></iframe> <iframe srcdoc="<img src=x onerror=alert(document.domain)>"></iframe>
  1. Create a new merge request from the new branch to master
  2. 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

bandicam_2021-07-14_13-33-47-160.mp4 From the original on HackerOne
bandicam_2021-07-14_13-26-29-234.mp4
bandicam_2021-07-14_13-22-17-346.mp4

The original report as published on HackerOne, by ba5d2d132de8622c890dd60. 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 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

  1. Go to GitLab.com.
  2. Create a new branch whose name contains HTML markup.
  3. Create a merge request from that branch to master.
  4. 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.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.