Bypassing WAF with incorrect proxy settings for Hunting Bugs.
The author found that a base64-encoded URL passed in a redirect parameter was decoded by an internal proxy (Bluecoat) and fetched server-side, so a request that the WAF blocked when sent directly could be delivered to an internal endpoint. This let the attacker reach a vulnerable internal endpoint with a malicious payload while bypassing the WAF.
Published on shaurya-sharma.medium.com
The odd thing was that while browsing the end node (something like) I received an HTTP 404 response from the server, which made me suspect the presence of WAF (Web Application Firewall).
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 redirect parameter was decoded and fetched by an internal proxy without validating the destination, so the WAF only inspected the encoded outer request rather than the decoded inner one.
Impact
An attacker could deliver a malicious payload to an internal endpoint that the WAF would otherwise block, potentially triggering the underlying vulnerability.
What the attacker needed
Target uses a WAF in front of the app; an internal proxy decodes the redirect parameter; a vulnerable internal endpoint exists
How it was found
- Notice that authentication redirects to the main domain with a base64-encoded address in a parameter.
- Decode the parameter and see it is the address the user was trying to reach.
- Send the vulnerable endpoint request directly and observe the WAF returns a 404.
- Base64-encode the full vulnerable URL and pass it in the redirect parameter.
- The WAF lets the request through, the proxy decodes the parameter and sends a GET request to the internal host, triggering the vulnerability.
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 site had a redirect parameter that carried a base64-encoded address; an internal proxy decoded it and made the request itself, so the filter only saw harmless-looking encoded text. The author could therefore send a malicious request to an internal endpoint that the filter would normally have stopped.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.