Skip to content
XSS Write-up Intermediate

An amazing way to turn a xss into an ATO

A reflected XSS was found via a hidden parameter that bypassed a simple filter by changing the case of the script tag. The attacker could then use JavaScript to read the CSRF token from the profile settings page and send a POST request to change the victim's email and country, leading to account takeover.

Naka Follow

Published on medium.com

In this write-up, I will discuss a bug that both myself and Flagc0 discovered in a program. Without further delay, let’s get into the details of the vulnerability.

Naka, 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 application reflected user input into the page without proper output encoding, and the CSRF token was exposed in the HTML source, allowing JavaScript to read it.

Impact

An attacker could change the victim's email and country, potentially leading to full account takeover.

What the attacker needed

Victim visits a malicious link or page; attacker can host an external JavaScript file

How it was found

  1. Find a hidden parameter that reflects input and bypass the filter by changing the case of the script tag.
  2. Use an external JavaScript file to avoid the filter blocking certain words.
  3. Fetch the profile edit page to extract the CSRF token.
  4. Send a POST request to the profile update endpoint with the token to change the email and country.

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.

Cross-site scripting (XSS) lets an attacker run their own JavaScript in a victim's browser on a trusted site. Here the attacker used that to read a secret token (CSRF token) that the site uses to prevent unauthorised changes, then used it to change the victim's email address. Changing the email can let the attacker reset the password and take over the account.

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.