Skip to content
XSS Disclosed report Intermediate

Stored-XSS in user's profile page

The user's profile page rendered the pronunciation field without sanitisation, allowing an attacker to inject HTML and script. An attacker could execute arbitrary JavaScript in a victim's browser when they viewed the profile.

GitLab

Originally disclosed on GitLab

  • Fixed in 9 days
  • Disclosed after 9 days

⚠️ Please read the process on how to fix security issues before starting to work on the issue. Vulnerabilities must be fixed in a security mirror.

HackerOne report #2371126 by yvvdwf on 2024-02-12, assigned to @cmaxim:

Report | How To Reproduce

Report

Hello,

Gitlab recently reorganized user's profile page:

Ruby
###  https://gitlab.com/gitlab-org/gitlab/-/blob/2934d5a2a640d195cb0c8df6f3d22d373cc88799/app/views/users/show.html.haml#L115

 %div= sprintf(s_("UserProfile|Pronounced as: %{div_start}%{pronunciation}%{div_end}"), { pronunciation: [@]user.pronunciation, div_start: '<div class="gl-font-sm gl-text-secondary gl-display-inline-flex">', div_end: '</div>' }).html_safe   

This allows injecting any HTML tags in user' profile page via [@]user.pronunciation, thus leading to XSS.

Reproduce

  • Login your account at https://gitlab.com
  • Goto Edit Profile page at https://gitlab.com/-/user_settings/profile
  • Fill Prononciation: XSS<i/class=hidden><form/class=gl-show-field-errors><input/title='<script>alert(document.domain)</script>'>
  • Click Update profile settings
  • View user' profile, e.g., https://gitlab.com/YOUR_USERNAME (please replace YOUR_USERNAME by your username)
  • You should see an alert generated by alert(document.domain) above

Note: XSS can be achieved via Pronouns.

Impact

Stored-XSS with CSP-bypass allows attackers to execute arbitrary actions on behalf of victims at the client side.

What is the current bug behavior?

Pronunciation (and Pronouns) is not sanitized

Output of checks

This bug happens on GitLab.com

Impact

Stored-XSS with CSP-bypass allows attackers to execute arbitrary actions on behalf of victims at the client side.

How To Reproduce

Please add reproducibility information to this section:

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

The pronunciation value was inserted into an HTML string that was marked as safe without sanitisation.

Impact

Stored XSS with a CSP bypass could let an attacker perform arbitrary actions on behalf of victims in their browser.

What the attacker needed

A user account; victim views the attacker's profile

How it was found

  1. Log in to your account on the target site.
  2. Go to the Edit Profile page.
  3. Enter a crafted value in the Pronunciation field.
  4. Click Update profile settings.
  5. View the user's profile page to see the script execute.

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 stored cross-site scripting (XSS) flaw lets an attacker save malicious code into a website's data, so it runs in other people's browsers later. Here, the pronunciation field on a profile page was not cleaned, so a script could be saved and then run when anyone viewed that profile.

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.