How I Found a Reflected XSS and Bypassed Wordfence WAF
A search parameter on a WordPress site reflected user input into an HTML attribute without proper encoding, allowing an attacker to inject an event handler. The author bypassed a Wordfence WAF by inserting angle brackets inside the event handler name, which the server stripped, resulting in a working reflected XSS.
I’m kerlous nasser (elko0k), in this article i will explain how i discovered a reflected xss and bypassed wordfence 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 application failed to properly encode user input when reflecting it into an HTML attribute, and the WAF's blocklist was bypassed by a server-side character removal that altered the payload.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser, potentially stealing sensitive data or performing actions on their behalf.
What the attacker needed
Victim visits a crafted URL
How it was found
- Enter a test string with special characters into the search box and observe reflection.
- Try an event handler payload and see it blocked by the WAF.
- Fuzz different event handler names using Burp Intruder, but none work.
- Notice that the server removes angle brackets when they appear together.
- Insert angle brackets inside the event handler name to evade the WAF, and the payload 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 lets an attacker put their own code into a web page that a victim views. Here, the search box echoed back what was typed without safely encoding it, so special characters could break out of an HTML attribute and add a JavaScript event handler. The attacker also found a way around a web application firewall (WAF) by using a quirk in how the server removed certain characters.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.