HOW I FIND XXS REFLECTED IN 5 SEC
A PHP page reflected a query-string value into its output without any filtering or sanitisation. An attacker could inject script that runs in a victim's browser and reads their cookies.
Published on medium.com
From my searches, I found a PHP file that had an interesting feature: it redirected input based on a query string:
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
What the attacker needed
Victim clicks a crafted link; target page reflects a query parameter
How it was found
- Find a PHP page that takes an id parameter in the query string.
- Try different values in the parameter to see how the page reflects them.
- Notice that the page returns the input without filtering or sanitisation.
- Put a script payload into the parameter and load the page to see it execute.
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 happens when a website takes something from the address bar and puts it straight into the page without cleaning it. If that value contains code, the browser runs it as if the site itself had written it, so the attacker's script can read things like the user's cookies.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.