Account Takeover via Cookie-Based Stored XSS ($1650 Bounty)
An endpoint stored a user-supplied value in a cookie and later reflected it without sanitisation, allowing stored cross-site scripting. An attacker could execute script in the victim's session and steal cookies, leading to account takeover.
medium.com
Published on medium.com
This write-up is not about the vulnerability itself, Stored XSS is a well-known class of issues, but rather to highlight the importance of heavy and recursive fuzzing, even on old or seemingly well-tested targets. With proper fuzzing, even hardened or previously tested applications can yield impactful vulnerabilities.
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 stored user input in a cookie and later reflected it into the page without proper output encoding or sanitisation.
What the attacker needed
Victim clicks a link or interacts with a page; attacker can host a malicious page
How it was found
- Fuzz directories and PHP files to find an endpoint.
- Fuzz parameters on that endpoint to discover set, user, and get.
- Set a cookie value via the set=true and user parameters.
- Retrieve the stored cookie value via the get=user parameter, which reflects it.
- Craft a malicious page that opens the set endpoint with a script payload, then redirects to the get endpoint to execute it.
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 had a feature that saved whatever text you gave it into a cookie (a small piece of data stored in your browser). Later, another page showed that saved text back without cleaning it, so if the text contained a script, the browser would run it. An attacker could trick a logged-in user into visiting a malicious page that sets the bad cookie and then loads the page that runs the script, letting the attacker steal the user's session.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.