SSRF with Filter Bypass via Open Redirection
The stock checker accepted URLs only from the app's own domain, but that domain had an open redirect. By supplying a trusted-domain URL that redirected to an internal address, an attacker could make the server fetch internal admin pages and delete a user.
medium.com
Published on medium.com
Some apps try to stop SSRF by checking the domain of the URL you give them. If the URL points to a trusted domain, it’s allowed.
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 SSRF filter validated only the initial URL's domain and did not re-check the destination after following redirects, while the trusted domain had an open redirect.
Impact
An attacker could reach internal systems that were supposed to be unreachable from outside, view the admin panel, and delete the user carlos.
What the attacker needed
Access to the stock checker feature; an open redirect on the trusted domain; knowledge of the internal IP address
The fix
The app should re-check the final destination after each redirect, disable automatic redirect-following, use an allowlist of exact URLs or IPs, fix open redirects, and block internal IP ranges at the network level.
How it was found
- Capture the stock check request in Burp and send it to Repeater.
- Try an internal IP directly in stockApi and observe it is blocked.
- Browse the site and find a nextProduct request with a path parameter that looks like a redirect target.
- Change path to an external site to confirm the open redirect.
- Set stockApi to the nextProduct URL with path pointing to the internal admin address.
- Find the delete link in the admin HTML and repeat the trick pointing path at it to delete carlos.
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.
SSRF (server-side request forgery) is when an app fetches a URL you supply, and you trick it into fetching something internal. Here the app checked only the domain name of the URL, not where it redirected. An open redirect on the trusted domain let the request bounce to an internal server.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.