Skip to content
XSS Disclosed report Intermediate

Stored-XSS injected in commit notes

GitLab

Originally disclosed on GitLab

  • Fixed in 42 days
  • Disclosed after 42 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 #2500163 by yvvdwf on 2024-05-10, assigned to @ottilia_westerlund:

Report | Attachments | How To Reproduce

Report

Hello,

This code is vulnerable:

JavaScript
...  
     const headerMessage = $systemNote  
        .find('.note-text')  
        .find('p')  
        .first()  
        .text()  
        .replace(':', '');

      $systemNote.find('.note-header .system-note-message').html(headerMessage);  
...  

It use text() function to get content of a p element, then later inject the content by html function. It allows to convert &lt;script&gt; to <script> for example, thus leads to XSS

Steps to reproduce

In gitlab.com, create a new project via Import project, then click Gitlab export button to import an exported GitLab project. Fill the form as you want and use demo.tar.gz in attached file to import to the new project.

import-project.png
import-project.png From the original on GitLab

Once the project has been successfully imported, click on Initial commit link to view the first commit of the project. You should see a popup alert which is caused by alert("Hello from " + document.location)

project.png
project.png From the original on GitLab

Impact

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

Best regards,
yvvdwf

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 June 2024. Fixed in version 17.2.

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.