Reflected XSS on Target with tough WAF ( WAF Bypass )
A forgotten test page reflected the charset parameter without sanitisation, allowing script execution. A tough WAF blocked common payloads, but the hunter found a tag and event combination that slipped through and executed in Chrome.
I was doing web pentest on a private program. The program had a very tough WAF even typing alert as a payload would be blocked by WAF.
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 test page reflected the charset parameter into the HTML response without encoding it, and the WAF's blocklist did not cover the chosen tag and event.
Impact
An attacker could run script in a victim's browser via a crafted link, though the payload only worked in Chrome.
What the attacker needed
Victim clicks a crafted link; Chrome browser; leftover test page reachable
How it was found
- Find the leftover test endpoint by directory bruteforcing.
- Send tag names from a cheat sheet in the charset parameter and note which are not blocked.
- Send event names from the cheat sheet and note which are not blocked.
- Combine an allowed tag and event to build a payload that executes.
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 value you put in a link is echoed back into the page as code, so the browser runs it. Here a leftover test page did this, and although a web application firewall (WAF, a filter that inspects requests) blocked most attempts, one unusual tag and event pair got through.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.