How I Earned My First Bug Bounty: POST BASED REFLECTED XSS
A login page reflected a POST parameter into an HTML attribute without sanitisation, allowing script injection. An attacker could craft a page that auto-submits the payload to the victim's browser and steal cookies.
medium.com
Published on medium.com
I’m a network engineer, but I used to play CTF as a hobby when I was free, and I decided to try bug bounty to gain experience as a bug hunter. Today, I’m going to share that experience with you.
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 reflected the POST parameter into an HTML attribute without encoding or validation.
Impact
An attacker could run script in a victim's browser and potentially steal their cookies, though the text only demonstrates an alert and does not show actual cookie theft.
What the attacker needed
Victim visits attacker page; target reflects POST parameter
How it was found
- Find a login page with a userid field.
- Try SQL injection, which fails.
- Inject a script payload into the userid value and see an alert.
- Build an HTML page that auto-submits the payload to the target.
- The victim visits the page and the script runs in their browser.
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 login form took a value the user typed and put it straight into the page's HTML without cleaning it. By sending a special value, the author made the page run their own JavaScript. A malicious page could then send that value for a victim and read their cookies.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.