Skip to content
SSRF Write-up Intermediate

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.

Anubhav_bora, on medium.com

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

  1. Capture the stock check request in Burp and send it to Repeater.
  2. Try an internal IP directly in stockApi and observe it is blocked.
  3. Browse the site and find a nextProduct request with a path parameter that looks like a redirect target.
  4. Change path to an external site to confirm the open redirect.
  5. Set stockApi to the nextProduct URL with path pointing to the internal admin address.
  6. 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.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.