Stored XSS in Full name when performing a search (without bypass csp)
A stored cross-site scripting vulnerability existed in GitLab's search results when a user's full name contained malicious HTML. An attacker could execute arbitrary JavaScript in a victim's browser when the victim searched for a term that matched the attacker's issue.
GitLab
Originally disclosed on GitLab
- Fixed in 6 months
- Disclosed after 6 months
HackerOne report #1218156 by solov9ev on 2021-06-05, assigned to @ankelly:
Report | Attachments | How To Reproduce
Report
Summary
Hi, Security Team!
I discovered a stored xss vulnerability without bypass csp when a user searches for information.
Steps to reproduce
-
Run Gitlab
docker run --detach --hostname gitlab.example.com --publish 443:443 --publish 80:80 --publish 22:22 --name gitlab gitlab/gitlab-ce:latest(GitLab Community Edition 13.12.2) -
Go to
/-/profileand insert the following malicious payload:1337<iframe srcdoc="<h1 onmouseover=prompt()><a href=javascript:alert()>click me</a>"></iframe>

- Create a issue:
My new Issue

- Go to
/search?utf8=✓&search=My+new+&group_id=&project_id=2&scope=issues&search_code=false&snippets=false&repository_ref=&nav_source=navbar


Impact
With this vulnerability, an attacker can for example steal users cookies or redirect users on malicious website.
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
- _________________2021-06-05_17-56-16.png
- _________________2021-06-05_17-58-05.png
- _________________2021-06-05_17-59-01.png
- _________________2021-06-05_17-59-16.png
How To Reproduce
Please add reproducibility information to this section:
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 application failed to properly sanitise or escape user-controlled input (the full name) when rendering search results, allowing HTML and JavaScript to be injected.
Impact
An attacker could steal users' cookies or redirect them to a malicious website.
What the attacker needed
Attacker can set full name; victim performs a search
How it was found
- Run a GitLab instance using Docker.
- Go to the profile page and insert a malicious payload into the full name field.
- Create an issue with a specific title.
- Perform a search that matches the issue title.
- Check the search results page for the payload.
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.
This is a stored cross-site scripting (XSS) bug. A user's name field allowed HTML code, and when that name appeared in search results, the code ran in the browser of anyone who searched. That could let an attacker steal cookies or redirect users.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.