Skip to content
XSS Disclosed report Beginner

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

  1. 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)

  1. Click on Cancel button 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

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 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

  1. Log in as a user with release edit permission and open the release edit page with a back_url value containing a javascript: URL.
  2. 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.

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.