From alert(origin) to ATO, an XSS Story
A nickname field on a user profile page reflected HTML-encoded input, and a filter that blocked complete tags could be bypassed with HTML-encoded tab characters, leading to stored XSS. The attacker then escalated this to account takeover by exfiltrating the victim's session cookies, though the report was closed as a duplicate.
Hey everyone, it’s Remmy. In this writeup, I’ll explain how I recently escalated an XSS vulnerability to an Account Takeover.
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 input filter only blocked complete, unencoded HTML tags and did not properly sanitise HTML-encoded characters, which the browser later decoded and executed.
Impact
An attacker could execute arbitrary JavaScript in the context of a logged-in victim's session, leading to account takeover by stealing session cookies; however, the payload only executed for authenticated users.
What the attacker needed
Victim must be logged in; attacker can set a nickname; victim views the attacker's profile
The fix
The application should properly sanitise and encode user input on output, rather than relying on a blocklist that can be bypassed with encoding.
How it was found
- Register a regular user account and log in.
- Navigate to the nickname editing feature and set a nickname.
- Save and exit to view the public profile page, where the nickname is reflected.
- Test with simple characters like '<' and '<i' to confirm reflection.
- Try '<img src=x' and observe it is blocked by the protection.
- Fuzz with HTML-encoded tab characters between tag name and attributes to bypass the filter and achieve XSS.
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.
The website let users set a nickname that was shown on their public profile. The site tried to block dangerous HTML tags, but by encoding the characters in a special way, the attacker got a script to run in the browser of anyone who viewed the profile. This let them steal the victim's login session 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.