*$$$$ 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.
Published on medium.com
While testing redacted.com, I came across what initially looked like a very ordinary reflected XSS vulnerability.
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
- Visit the dashboard endpoint with a crafted next parameter containing an image tag with an error handler.
- Confirm the JavaScript executes in the page.
- Observe that document.cookie does not expose the authentication cookies because they are HttpOnly.
- Use the XSS to send a same-origin JSON POST to the account email-change endpoint with the attacker's email.
- 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.