From Frustration to Exploitation: How a Link Shortener Helped Me Bypass WAF
A reflected XSS payload in a search parameter was blocked by the site's WAF when sent directly. The author found the site's own link shortener would redirect to the crafted search URL, and following that short link caused the script to execute, apparently bypassing the filter.
While Hunting, Have you ever been in a situation where you’re trying your best to execute a well-crafted payload, only to be met with a stern 403 Forbidden? I’ve been there, and it’s both infuriating and humbling.
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 search parameter was reflected into the page without proper output encoding, and the WAF only inspected direct requests, not requests arriving via the site's short-link redirect.
Impact
An attacker could run script in a victim's browser on the site's domain via a short link, though the text does not show what data or actions that script could reach.
What the attacker needed
Victim clicks a short link; site has a link shortener feature
How it was found
- Try an XSS payload in the search parameter and observe a 403 from the WAF.
- Find the site's built-in link shortener feature.
- Generate a short link pointing at the search URL containing the payload.
- Visit the short link and observe the redirect to the search URL.
- See the script execute on the search page.
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 search box on a website put whatever you typed straight back into the page. If you type code instead of words, the browser can run it, which is called cross-site scripting (XSS). A firewall (WAF) was blocking the code when sent directly, but the site's own short-link service redirected to the same address and the code ran anyway.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.