SSRF with Blacklist-Based Input Filter:Write-up
The stock-check feature fetched a user-supplied URL server-side but only blocked literal strings like [redacted], localhost and admin. By using a short-form loopback address and a double-encoded path, an attacker could reach the internal admin panel and delete a user.
medium.com
Published on medium.com
Some applications try to block SSRF by blacklisting known-sensitive strings like 127.0.0.1, localhost, or /admin. These filters are usually naive string-matchers, not real network-layer controls, so they can be bypassed with:
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
The application relied on a naive string blacklist instead of resolving and validating the destination, and it decoded input at different stages so double-encoded text bypassed the filter but still routed to the blocked path.
Impact
An attacker could reach the internal admin panel and delete the user carlos, and more generally could use the server to access internal services that are not exposed to the internet.
What the attacker needed
Access to the stock-check feature; ability to intercept and modify requests
The fix
The application should use an allowlist of approved destinations, resolve hostnames and validate the resulting IP against private ranges, re-check every redirect, normalise input before filtering, and restrict outbound access at the network layer.
How it was found
- Intercept the Check stock request and send it to Repeater.
- Replace the stockApi value with an internal target such as the loopback address or localhost; both are blocked.
- Use an alternative representation of the loopback address to bypass the hostname check.
- Double-encode part of the admin path so the path filter does not match.
- Read the reflected admin panel and find the delete-user endpoint.
- Point stockApi at the delete endpoint for the target user and send the request.
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.
The website had a feature that asked the server to fetch a web address the user typed in. The site tried to stop people pointing it at internal pages by blocking a few words, but the check was easy to trick. The attacker wrote the same internal address in a different way and got the server to visit its private admin page.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.