XSS on Labels' description
An XSS vulnerability existed in GitLab's label descriptions, allowing an attacker to execute arbitrary JavaScript when a user hovered over a label title in an issue discussion. The exploit worked on Firefox due to SVG use element handling.
GitLab
Originally disclosed on GitLab
- Fixed in 9 months
- Disclosed after 9 months
HackerOne report #882629 by yvvdwf on 2020-05-26, assigned to @vdesousa:
Dear team,
Summary
XSS can occur in the labels' description. The exploitation is the same as in #831962. Consequently it occurs on Firefox. It does not work on Webkit-based ones such as Safari, Chrome. I haven't tested on Edge.
It must occurred also in older browser due to svg4everybody() and cachedDocument.body.innerHTML = xhr.responseText
Steps to reproduce
-
Create a new label with any title but the following description:
description <svg><use xlink:href="/yvvdwf/data/-/raw/js/xss.svg#xss"/></svg> -
Open an issue or create a new one, then assign the label above to it
-
In the Discussion of the issue, you should see a text confirming that the label has been added to the issue. Hover cursor over the label's title, an alert will be fired.
Impact
Attacker may perform arbitrary actions on behalf of users at the client side.
Examples
An example is on https://gitlab.com/yvvdwf/svg-use-xss-firefox
This project is private. Please let me know if you cannot access it.
What is the expected correct behavior?
Malicious scripts must not be executed due to svg content.
Output of checks
This bug happens on GitLab.com (GitLab Enterprise Edition 13.1.0-pre 66cb66d941d )
Impact
Attacker may perform arbitrary actions on behalf of users at the client side.
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
Impact
An attacker could perform arbitrary actions on behalf of users at the client side, but the exploit only worked on Firefox and not on WebKit-based browsers.
What the attacker needed
Victim uses Firefox; attacker can create a label; victim hovers over label title
How it was found
- Create a new label with any title and a description containing an SVG use element pointing to an external SVG file.
- Open or create an issue and assign the label to it.
- In the issue discussion, hover over the label's title to trigger the alert.
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.
Cross-site scripting (XSS) is a flaw where a website shows user-supplied content without properly neutralising it, so a malicious script runs in a victim's browser. Here, a label description containing a crafted SVG element caused script execution when the label was hovered, letting an attacker act as the victim.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.