Skip to content
XSS Write-up Advanced

XSS — Bypassing WAF with Hex Overflow

The target's URL decoder mishandled malformed percent-encoded sequences, allowing characters such as '=' to be produced in unexpected ways. This let the author bypass an F5 BIG-IP WAF's blocking of event handlers and the alert function, achieving reflected XSS.

medium.com

Published on medium.com

Hello, I’m Syed Mushfik Hasan Tahsin aka SMHTahsin33. A 20 Y/O Cyber Security Enthusiast from Bangladesh.

SMHTahsin33, 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 a malformed URL decoder that accepted out-of-range hex digits and produced unintended ASCII characters, letting an attacker construct blocked characters such as '=' without using their normal encoding.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser, though the text does not describe any specific harm beyond the XSS itself.

What the attacker needed

Reflected input on the target; F5 BIG-IP WAF in front of the app; victim visits a crafted URL

How it was found

  1. Confirm the input is unsanitised by submitting a simple SVG onload payload, which the WAF blocks.
  2. Probe to find that the onload= part with the equal sign is what gets blocked.
  3. Discover that malformed percent sequences such as %3= are decoded to '=' by the target's decoder.
  4. Use the alternate encoding for '=' in an SVG onload payload, which is still blocked because alert() is filtered.
  5. Replace alert() with optional chaining alert?.() to bypass the function filter and trigger the script.

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 web application firewall (WAF) is a filter that tries to block malicious input such as script code. Here the filter was fooled because the site's own URL decoder turned strange percent-encoded text into characters the filter did not expect, so a script tag slipped through.

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.