Skip to content
XSS Disclosed report Beginner CVE-2018-10379

Persistent XSS - Selecting users as allowed merge request approvers

A user's display name was not properly escaped when rendered in the merge request approvers dropdown, allowing an attacker to inject a script that executes in the browser of a project Master who views the dropdown. This could lead to actions being performed on behalf of the victim.

phillycheeze Follow

Originally disclosed on HackerOne

  • Triaged in 3 days
  • Fixed in 28 days
  • Disclosed after 2 months

Summary: When using the dropdown that selects the users that are allowed to approve a merge request, it is possible to trigger a XSS with a malicious user name string.

Description: This vulnerability is similar to the recently announced CVE-2018-10379 (and another vulnerability I recently reported here in hackerone).

The steps to reproduce are fairly simple but there are some restrictions:

Steps To Reproduce:

  1. Set your own username as "<img src=x onerror=alert(document.domain)> foo / bar"
  2. Make yourself have at least Master access to a project
  3. Under Project Settings -> General -> Merge Request Settings,click the "Merge request approvals" checkbox
  4. Select the user dropdown input for selecting eligible users to approve merge requests
  5. Notice that the onerror attribute from the username renders.

Supporting Material/References:

More information can be provided upon request.

Suggested Remediation

Like the previous report I submitted, it is due to improper sanitization in a JS file. I believe this is the offending line: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/ee/app/assets/javascripts/approvers_select.js#L134

Impact

The security impact is the same as any typical persistent xss.

The hacker selected the Cross-site Scripting (XSS) - Stored weakness. This vulnerability type requires contextual information from the hacker. They provided the following answers:

URL https://gitlab.com/group/project/edit

Verified Yes

The original report as published on HackerOne, by phillycheeze. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 approvers select JavaScript component inserted the username into the DOM without proper escaping or sanitisation.

Impact

The security impact is the same as any typical persistent XSS, potentially allowing an attacker to execute arbitrary JavaScript in the context of a victim's session.

What the attacker needed

Starter or higher subscription; Victim has Master access to a project

How it was found

  1. Set your own username to a string containing an image tag with an onerror handler.
  2. Ensure you have at least Master access to a project.
  3. Enable merge request approvals in the project settings.
  4. Open the user dropdown for selecting eligible approvers.
  5. Observe that the onerror handler from the username executes.

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.

When you type a name into a website, the site should display it as plain text, not run it as code. Here, the site inserted a user's name into a dropdown without cleaning it, so a name containing HTML and JavaScript ran as code in the browser of anyone who opened that dropdown. This is called cross-site scripting (XSS), and it lets an attacker run their own code in someone else's session.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by phillycheeze

View all

2 more disclosed reports, best first.

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.