Skip to content
XSS Disclosed report Advanced

A CSP-bypass XSS in merge-request error messages

GitLab

Originally disclosed on GitLab

  • Fixed in 14 days
  • Disclosed after 14 days

⚠️ Please read the process on how to fix security issues before starting to work on the issue. Vulnerabilities must be fixed in a security mirror.

HackerOne report #2994150 by yvvdwf on 2025-02-14, assigned to @fvpotvin:

Report | Attachments | How To Reproduce

Report

Hello,

Gitlab recently released a fix of #2930243 by removing the ability of HTML injection via branch name.

I found another HTML injection via an error message of merge request. For example an XSS can occurs when setting merge_error as below:

"merge_error":"<a class=add-review-item-modal-trigger data-commits-empty=true>Loading ...<i class='add-review-item-modal-wrapper' data-context-commits-path=../raw/main/data.json></a><!--"  

Reproduce

The following steps are to reproduce on gitlab.com

As attacker
  • create a new project by importing a Gitlab export which is in the attached file ( which is a Gitlab export which contains a merge request and I modified merge_error in merge_requests.ndjson as above)
  • change the visibility of the project to public or invite victim as a Developer member of the project
As victim
  • there is only one merge request in this project, open it, then click Commits, then click Overview, then click Add previously merged commits button
clicks.png
clicks.png From the original on GitLab
  • go to User / Preferences / Access tokens, then you notice that there is an access token created by attacker

Impact

XSS with CSP-bypass allows attackers to execute arbitrary actions on behalf of victims at the client side.

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

How To Reproduce

Please add reproducibility information to this section:

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

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

What is known

A high-severity XSS bug in gitlab.com. GitLab made it public on 26 March 2025. Fixed in version 17.11.

About XSS

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

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

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.