XSS | Here’s How I Got My First Bounty
A search bar reflected user input into an HTML attribute without filtering double quotes, allowing an attacker to break out of the attribute and inject an event handler. This let the author trigger a JavaScript alert popup, demonstrating reflected cross-site scripting.
Not so long ago, I was reading blogs like this, wondering how to find my first vulnerability in a bug bounty program and probably not thinking that I would get a bounty a little after.
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 user input into an HTML attribute without encoding or filtering double quotes, allowing attribute breakout.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser when the victim interacts with the crafted search input, potentially leading to session theft or other client-side attacks.
What the attacker needed
Victim visits a crafted URL or interacts with the search…
How it was found
- Enter a random string in the search bar and observe the response in Browser DevTools.
- Notice that double quotes are not filtered in the reflected output.
- Insert a double quote to close the existing attribute.
- Add an event handler payload to the div tag to trigger JavaScript.
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.
When you type something into a search box, the website often shows it back to you on the results page. If the site does not clean up special characters like double quotes, an attacker can type extra code that the browser treats as part of the page. That lets the attacker run their own JavaScript in the victim's browser, which is called cross-site scripting (XSS).
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.