WAF Bypass — Parameter Poisoning
A WAF blocked requests containing an illegal character in the first id parameter, but when a second id parameter was added, the WAF failed to inspect it, allowing a script tag to pass through. An attacker could deliver XSS or other malicious input past the WAF.
Published on medium.com
I was doing a bug bounty on my favorite company, and was testing some API calls for IDORS / robustness, after some time i found a route called: /api/images/v5/cheered/bulk?id=playerIdHere
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 WAF only validated the first occurrence of a repeated parameter and did not inspect subsequent parameters with the same name.
Impact
A failing WAF could make it easier for an attacker to deliver attacks such as XSS, SQLi or RCE, though the text does not show exploitation beyond bypassing the filter.
What the attacker needed
Access to the API endpoint; ability to send repeated parameters
How it was found
- Send a request to the bulk endpoint with a single id parameter containing a hash character, which causes a 400 error.
- Add a second id parameter with a normal value and observe that the request succeeds and returns data for the second id.
- Replace the second id value with a script tag and observe that the request is no longer blocked by the WAF.
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 inspects incoming requests and blocks ones that look malicious. Here, the filter only checked the first copy of a parameter and ignored a second copy with the same name, so a harmful value slipped through. This means the WAF did not actually protect the site from that request.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.