HexBrain

GitLab · Report #409380

Stored XSS in merge request pages

Validstatus
highseverity
18upvotes
3 Dec 2018disclosed

How it was found

Summary: I found a Stored XSS in merge request pages.

Description: The exploit is via the parameter merge_request[source_branch] of the request to create a New Merge Request.

Steps To Reproduce:

  1. Sign ikn to GitLab.
  2. Click the "[+]" icon.
  3. Click "New Project".
  4. Fill out "Project name" form with "test-project".
  5. Check the radio button of "Public".
  6. Check the "Initialize repository with a README".
  7. Click "Create project" button.
  8. Go to "http(s)://{GitLab host}/{user id}/test-project/branches/new".
  9. Fill out each form as follows:
  • Branch name: test-branch
  • Create from: master
  1. Click "Create branch" button.
  2. Go to "http://{GitLab host}/{user id}/test-project/merge_requests".
  3. Click "Create merge request" button.
  4. Click "Submit merge request" button.
  5. Intercept the request.
  6. Change the merge_request[source_branch] parameter's value to <img/src=x onerror=alert(1)>
  7. Send the request.

Result: poc.png

Note: This behavior can be reproduced on all modern browsers.

Impact

The security impact is the same as any typical Stored XSS.

Thank you.

This report was disclosed publicly on HackerOne and belongs to its author and the program. See the original