Skip to content
SSRF Write-up Intermediate

The SSRF That Wasn’t Supposed to Work Twice

An image-preview feature fetched user-supplied URLs without properly validating the destination IP, allowing a decimal-encoded IP to bypass a hostname denylist and reach the cloud metadata service. The attacker could obtain temporary cloud credentials and, by pivoting through the same SSRF primitive, reach an internal API that exposed a billing service API key.

t3nv1 Follow

Published on medium.com

This one has a twist in it, so bear with the setup. The bug wasn’t hard to find.

T4nv1, 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

Likely the application validated the destination by matching hostname strings against a denylist instead of resolving the final IP and checking it against blocked address ranges at request time.

Impact

The attacker could obtain temporary cloud credentials and use the SSRF as an unauthenticated pivot into the internal network, reaching a billing service API key; the text notes the initial role was scoped down, but the second chain showed a real path to a billing system credential.

What the attacker needed

Access to the image preview feature; ability to supply an arbitrary URL; no authentication required for the internal API

The fix

The fix was to allowlist permitted destination IP ranges resolved and checked at request time, add a network egress rule blocking image workers from internal services, and rotate all reachable credentials.

How it was found

  1. Send a preview request with the cloud metadata IP in dotted form; it is blocked.
  2. Send the same IP expressed as a decimal integer; the request succeeds and returns an IAM role name.
  3. Request the role's credentials path to obtain temporary access keys.
  4. Use the decimal-encoded IP with a path traversal to reach an internal API gateway.
  5. Request the internal debug configuration endpoint, which returns internal hostnames, a database connection string, and a billing API key.

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 app let users give it a web address to download an image. The server did not check carefully where that address really pointed, so a cleverly written address made the server fetch sensitive internal pages instead. That let the attacker steal cloud login keys and reach internal systems that were never meant to be public.

What is SSRF?

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

More by t3nv1

View all

3 more disclosed reports, best first.

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.