How I Found 6 Reflected XSS — and Turned Them into Account Takeover
A search field on a subdomain reflected user input back into the page, allowing script to run in a victim's browser. The author showed that a crafted link could send a victim's cookies to an external collection endpoint, which they presented as session theft and account takeover.
Published on potatohuman.medium.com
I love hunting on wildcards. There’s something satisfying about a good subdomain enumeration: it teases out the surface area you wouldn’t otherwise see, and most of the real problems hide where you don’t expect them.
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 search query parameter was written into the HTML response without encoding, so markup and script supplied in the URL were treated as page content.
Impact
If a victim opens the crafted link, their session cookies could be sent to an attacker-controlled endpoint, which the author frames as account takeover; the text gives no evidence that the cookies were actually usable to log in as the victim.
What the attacker needed
Victim clicks a crafted link; attacker hosts a script endpoint
How it was found
- Enumerate subdomains of the program's wildcard scope and browse them.
- Notice that the search field on one subdomain reflects input back into the response.
- Run parameter discovery tools, then inspect requests manually to find the exact query parameter being reflected.
- Build a link whose search query contains script that loads an external script.
- Open the crafted link and observe the victim's cookies arriving at the external collection endpoint.
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 means a website takes something you typed, such as a search term, and puts it straight into the page without cleaning it. If that text is actually code, the browser runs it as if the site itself wrote it. Here the author showed that a link could make a visitor's browser send their login cookies to a server the author controls, which can let someone else act as that user.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.