My Journey to Finding Two XSS Vulnerabilities on a Bug Bounty Website
Two query parameters on a bug bounty website reflected user input into HTML without proper encoding, allowing script execution. An attacker could craft a link that runs JavaScript in a victim's browser.
Published on medium.com
Bug bounty hunting can sometimes feel like searching for a needle in a haystack. Hours of digging, testing payloads, and analyzing behavior can lead to dead ends, but every once in a while, perseverance pays off.
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 query parameter values into the page without HTML-encoding them, so a closing tag followed by a script tag was interpreted as markup.
Impact
An attacker could run arbitrary JavaScript in a victim's browser by getting them to open a crafted link, though the text does not describe any further actions such as stealing data.
What the attacker needed
Victim clicks a crafted link
How it was found
- Look through pages, URLs and parameters for unusual input points.
- Test the fv query parameter with several script and image payloads.
- Try a payload that first closes an existing title element, then adds a script tag with mixed case.
- Observe the alert box confirming script execution.
- Move to the memegen page and test the open_img_url parameter with a similar closing-tag payload.
- Observe a second alert box confirming the second vulnerability.
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.
Cross-site scripting (XSS) happens when a website takes text from the address bar and puts it directly into the page without cleaning it. If that text contains code, the browser runs it as if the site itself had written it. Here, two different address-bar values let the author make an alert box appear.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.