Skip to content
XSS Write-up Intermediate

Stored XSS → Account Takeover

A stored cross-site scripting (XSS) vulnerability existed in the last name field, which could be injected via the invite user feature. An attacker could exploit this to steal a victim's refresh token from localStorage and achieve account takeover.

medium.com

Published on medium.com

My name is Islam Adel, and I’m a Bug Bounty Hunter. I discovered this vulnerability and wanted to share it with you.

s0ly, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The application did not properly sanitise user-supplied input in the last name field, allowing script injection that persisted and executed in other users' browsers.

Impact

An attacker could take over user accounts by stealing refresh tokens, leading to unauthorized access to sensitive data and actions on behalf of the victim.

What the attacker needed

Attacker can invite a user to a project; victim clicks the invitation link; victim sets a password and may change name

How it was found

  1. Navigate to the profile avatar section to change the username.
  2. Inject an XSS payload into the last name field and observe it execute.
  3. Use the 'Invite User' functionality to set a malicious full name for the invited user.
  4. The invited user sets their password and may change their name; if they replace the full name with a single word, the payload remains as the last name.
  5. The payload executes when the name is rendered in the UI.
  6. Craft a payload to read the refresh_token from localStorage and exfiltrate it to an attacker-controlled server, bypassing the WAF.

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 write-up has not been written yet. The Original tab links to the source.

Stored XSS is when a website saves malicious code you type into a form and later shows it to other users, making their browsers run that code. Here, an attacker could put a script in a user's name field, and when the victim viewed their profile, the script ran and stole a token that let the attacker log in 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.

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.