Skip to content
XSS Disclosed report Beginner

Self-XSS in Gitlab manifest file import

The GitLab manifest import page rendered a remote review URL from the uploaded manifest as a clickable link without validating its scheme, so a javascript: URL could run script when clicked. An attacker could use this for self-XSS to steal a user's session on self-hosted GitLab instances.

GitLab

Originally disclosed on GitLab

  • Fixed in 4 months
  • Disclosed after 4 months

HackerOne report #1036636 by shells3c on 2020-11-17, assigned to @dcouture:

Report | How To Reproduce

Report

Description

XSS in the Gitlab manifest Import page.

Steps to reproduce

manifest.xml

XML
<manifest>  
  <remote review="javascript://HelloTheGitlabSecurityTeam<3%0Aprompt(1)%0A" />

  <project path="test1" name="manifest1" />  
  <project path="test2" name="manifest2" />  
  <project path="test3" name="manifest3" />  
  <project path="test4" name="manifest4" />  
  <project path="test5" name="manifest5" />  
  <project path="test6" name="manifest6" />  
</manifest>  
  • Choose that file to import, click List available repositories
  • On the Import page, click on the link and XSS

Impact

Self-XSS, use to steal the user session in self-hosted Gitlab instances.

How To Reproduce

Please add reproducibility information to this section:

  1. New project
  2. Import from a manifest
  3. Use this manifest https://gitlab.com/gitlab-org/gitlab/-/issues/284676#note_450121622

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.

How it worked

Root cause

Likely the import page rendered the manifest's remote review attribute as a link without restricting the URL scheme to safe values such as http or https.

Impact

Self-XSS could be used to steal the user session on self-hosted GitLab instances, but only if the victim clicks the crafted link.

What the attacker needed

Victim uploads a crafted manifest; victim clicks the link

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 import a manifest file, GitLab shows a link to a remote review location. The report says that link was not checked, so it could be a javascript: link that runs code in the page when clicked. This is called self-XSS because the victim has to click the link themselves.

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.