Skip to content
XSS Write-up Intermediate

Tricky waf bypass for reflected XSS write up

A reflected open redirect placed user input inside an anchor tag whose href was used by JavaScript for redirection, and the site's WAF blocked ordinary XSS payloads. By inserting line breaks and tabs into the javascript scheme, the author got a payload past the filter that executed script when the redirect link was clicked.

sonahri501 Follow

Published on medium.com

i started 100 day hacking challenge yesterday and for first 3,4 hours i was working on a file upload bug. but could not exploit it. my recon script was running in background(it was xssorRecon :) ) i use it to crawl urls and then check them manually . there was a simple open redirect where my payload was landing in <a>…

Sonahri, 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 placed user input into an anchor's href without proper output encoding, and the WAF only matched the literal javascript scheme rather than its whitespace-obfuscated forms.

Impact

An attacker could execute script in a victim's browser, but only after the victim clicked the redirect link on the page.

What the attacker needed

Victim clicks a crafted link; victim clicks the redirect link on the page

How it was found

  1. Send a few characters to see which are filtered.
  2. Try XSS payloads and observe the WAF blocking them.
  3. Find a payload that lands untouched in the HTML but does not fire immediately.
  4. Notice the page waits five seconds before redirecting, with a link to redirect immediately.
  5. Click the link and the script 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's text appear on a page and be treated as code by the browser. Here the site put the visitor's input into a link, and the author found a way to sneak a script instruction past the security filter (a WAF, a tool that inspects requests and blocks suspicious ones) by breaking up the word with invisible characters.

What is XSS?

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

More by sonahri501

View all

1 more disclosed report, best first.

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.