Skip to content
XSS Write-up Intermediate

*$$$$ How I Turned a ‘Low Severity’ Reflected XSS into Full A

A reflected XSS in a dashboard parameter let an attacker run JavaScript in the victim's browser on the trusted origin. Because the session cookies were HttpOnly, the attacker instead used the victim's authenticated session to call a JSON email-change endpoint, then triggered a password reset to take over the admin account.

Ashar Mahmood Follow

Published on medium.com

While testing redacted.com, I came across what initially looked like a very ordinary reflected XSS vulnerability.

Ashar Mahmood, 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 dashboard parameter reflected user input into HTML without sanitisation, and the email-change API trusted same-origin requests without an additional anti-CSRF token check.

Impact

An attacker could silently change an administrator's email and then reset the password, leading to full admin account compromise and persistent access.

What the attacker needed

Victim clicks a crafted link; victim is logged in as an administrator

How it was found

  1. Visit the dashboard endpoint with a crafted next parameter containing an image tag with an error handler.
  2. Confirm the JavaScript executes in the page.
  3. Observe that document.cookie does not expose the authentication cookies because they are HttpOnly.
  4. Use the XSS to send a same-origin JSON POST to the account email-change endpoint with the attacker's email.
  5. Trigger the forgot-password flow for the victim's account and complete the reset using the attacker-controlled email.

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.

A reflected cross-site scripting (XSS) bug lets an attacker put their own JavaScript into a page the victim visits. The site had protected the login cookie so scripts could not read it, but the script still ran as the site itself. That meant it could quietly ask the site to change the victim's email address, and from there the attacker reset the 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 Ashar Mahmood

View all

3 more disclosed reports, 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.