Skip to content
XSS Write-up Intermediate

How I Turned a “Harmless” Self-XSS into a Full Account Takeov

A self-XSS in the profile bio field could be combined with a missing CSRF token on the profile update endpoint to force a victim's browser to save the XSS payload into their own bio. When the victim later viewed their profile, the script executed and changed their password, leading to full account takeover.

Sada devre Follow

Published on medium.com

It was 2:00 AM. I had just found a stored XSS on a target’s profile bio field.

Sada devre, 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

Likely the profile update endpoint lacked CSRF protection, allowing an attacker to force a logged-in user to save an XSS payload into their own bio, which then executed in their session.

Impact

An attacker could achieve complete account takeover by changing the victim's password, with no interaction beyond visiting a malicious link.

What the attacker needed

Victim is logged in; victim visits attacker's page; victim views their own profile

How it was found

  1. Craft an XSS payload that changes the password via an API call.
  2. Build an HTML page on an attacker server that submits a form to the profile update endpoint with the XSS payload as the bio.
  3. Victim visits the attacker page while logged in, and their bio is silently updated.
  4. Victim navigates to their own profile, triggering the XSS.
  5. The XSS executes and changes the victim's password.
  6. Attacker logs in with the new password.

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.

Self-XSS is a script that only runs in your own browser, so it seems harmless. But if an attacker can make your browser save that script into your profile, it will run when you view your profile. Here, a missing security token on the profile update allowed an attacker to do exactly that, and the script then changed the victim's password.

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 Sada devre

View all

1 more disclosed report, best first.

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.