Stored XSS in Iteration descriptions
The iteration description field on GitLab stored user input without properly sanitising it, so an HTML image tag with an error handler ran as script. Anyone who opened the iteration details page would have the script execute in their browser.
GitLab
Originally disclosed on GitLab
- Fixed in 4 days
- Disclosed after 4 days
HackerOne report #926182 by ashish_r_padelkar on 2020-07-17, assigned to @jeremymatos:
Summary
Hello,
I found a stored XSS in iteration description field which affect other users too!
Steps to reproduce
-
Create a iteration at
https://gitlab.com/groups/<GroupName>/-/iterations/newwith XSS payload">{{media:0}}inDescription. -
Whoever visits the page iteration details page
https://gitlab.com/groups/<GroupName>/-/iterations/<ID>will see XSS trigger!
What is the current bug behavior?
Stored XSS in Iteration Description field
What is the expected correct behavior?
Inputs should be properly sanitised to remove event handlers.
Output of checks
This bug happens on GitLab.com
Regards,
Ashish
Impact
Stored XSS affecting other users!
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 iteration description was rendered as HTML without sanitising event handler attributes.
What the attacker needed
A GitLab account able to create iterations; victim opens the iteration page
How it was found
- Create a new iteration in a group with a crafted description containing an image tag with an error handler.
- Open the iteration details page as any user to see the script run.
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.
A stored cross-site scripting (XSS) bug means text a user saves is later shown to other people as part of the page, and the browser treats part of that text as code. Here, a description containing an image tag with an error handler caused a pop-up to run for every visitor of the iteration page. The fix is to clean the input so such handlers are removed.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.