Skip to content
XSS Write-up Intermediate

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.

elko0k Follow

Published on medium.com

I’m kerlous nasser (elko0k), in this article i will explain how i discovered a reflected xss and bypassed wordfence WAF.

elko0k, on medium.com

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

  1. Enter a test string with special characters into the search box and observe reflection.
  2. Try an event handler payload and see it blocked by the WAF.
  3. Fuzz different event handler names using Burp Intruder, but none work.
  4. Notice that the server removes angle brackets when they appear together.
  5. 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.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.