Skip to content
XSS Write-up Intermediate

Reflected XSS with WAF Bypass — A Creative Payload That Worked

A promotional page reflected the sale_price parameter into HTML without proper encoding, allowing script injection. The author bypassed the site's WAF using deeply nested broken tags and an obfuscated javascript: link, achieving a JavaScript pop-up.

FOYSAL AHMED FAHIM Follow

Published on foysal1197.medium.com

Hi everyone, I’m Foysal Ahmed Fahim, a bug bounty hunter who’s always fascinated by creative XSS exploitation. Today, I’m sharing a story about a Reflected Cross-Site Scripting (XSS) vulnerability I discovered on a well-known e-commerce site, where the trick wasn’t just finding the XSS — it was bypassing the WAF to…

FOYSAL AHMED FAHIM, on foysal1197.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 reflected user input into HTML attributes without proper output encoding, and the WAF's pattern matching could be bypassed with nested broken tags and obfuscated JavaScript.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser via a crafted link, potentially leading to data theft or actions on behalf of the user, though the WAF initially blocked simple attempts.

What the attacker needed

Victim clicks a crafted link; WAF present but bypassable

The fix

The application should properly encode user input before reflecting it into HTML, and the WAF should be updated to detect obfuscated payloads.

How it was found

  1. Identify a suspicious parameter on a promotional page that reflects into the HTML response.
  2. Try simple XSS payloads and observe they are blocked by a WAF.
  3. Attempt various bypass techniques such as event handlers and encoding, all failing.
  4. Analyse how input is reflected into the DOM, focusing on HTML attributes and nested tags.
  5. Craft a payload with many unclosed div tags and an obfuscated javascript: link to bypass the WAF.
  6. Confirm JavaScript execution by observing a pop-up.

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.

Reflected XSS happens when a website takes something you typed (like a URL parameter) and puts it straight into the page without cleaning it. An attacker can craft a link that makes the victim's browser run the attacker's JavaScript, which could steal data or perform actions as the victim. Here, a firewall tried to block common attack patterns, but the author found a way around it.

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.