XSS in release Edits
The back_url parameter in release edit URLs was reflected into the Cancel button's link without validation, allowing a javascript: URL. An attacker could craft a link that, when clicked by a user with release edit permission, would execute script in the user's browser, though CSP blocked it on gitlab.com.
GitLab
Originally disclosed on GitLab
- Fixed in 15 months
- Disclosed after 15 months
HackerOne report #834555 by ashish_r_padelkar on 2020-03-30, assigned to @ankelly:
Summary
Hello,
I found a XSS that happens because of back_url parameter in release Edit URLs.
https://gitlab.com/<GroupName>/<ProjectName>/-/releases/<ReleaseName>/edit?back_url=javascript:alert(1)
Steps to reproduce
- Login as a user who has release edit permission in a project and navigate to
https://gitlab.com/<GroupName>/<ProjectName>/-/releases/<ReleaseName>/edit?back_url=javascript:alert(1)
- Click on
Cancelbutton on the page, You should see XSS but it doesnt execute on gitlab.com because of csp
What is the current bug behavior?
XSS because of back_url in url
What is the expected correct behavior?
Currently back_url parameter is reflected in button click which should not happen. This is also a candidate for open redirect.
Output of checks
This bug happens on GitLab.com and might be on omnibus installations
Regards,
Ashish
Impact
XSS
Open redirect
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 reflected the back_url parameter directly into a link without validating that it was a safe URL scheme.
Impact
An attacker could execute script in the browser of a user with release edit permission, but on gitlab.com the Content Security Policy blocked execution; the parameter could also be used for open redirect.
What the attacker needed
Victim has release edit permission; victim clicks a crafted link; CSP must not block script execution
How it was found
- Log in as a user with release edit permission and open the release edit page with a back_url value containing a javascript: URL.
- Click the Cancel button on the page to trigger the script.
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 web page sometimes uses a value from the address bar to decide where a button takes you. Here, the 'Cancel' button used a value called back_url without checking it was a safe web address. An attacker could put a script instruction in that value, so clicking Cancel would run their code in the victim's browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.