Skip to content
SSRF Write-up Intermediate

I Was Testing a “URL Preview” Feature… and Ended Up Inside

The URL preview feature fetched user-supplied URLs without properly validating them, so blocking only the literal localhost address could be bypassed with a decimal-encoded IP. The attacker could then reach the cloud instance metadata service and pull IAM credentials.

T4nv1 Follow

Published on medium.com

It was one of those clean, modern apps — polished UI, fast APIs, nothing obviously broken. The kind where you spend an hour and feel like everything important is already locked down.

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

The application used a blacklist that blocked only the literal strings for localhost and [redacted] instead of resolving and validating the destination address properly.

Impact

The attacker could read cloud instance metadata, which may expose IAM roles and temporary credentials, potentially giving access to the cloud environment; the text notes the response was not clean but enough came back.

What the attacker needed

Access to the URL preview feature; server can make outbound requests; cloud metadata service reachable

How it was found

  1. Send a normal external URL to the preview endpoint and confirm it fetches metadata.
  2. Send an invalid domain and observe a timeout, showing the server really makes the request.
  3. Send localhost and [redacted] and see them blocked.
  4. Send the decimal-encoded form of [redacted] and see the block no longer applies.
  5. Point the feature at an attacker-controlled server and confirm the hit in the logs.
  6. Request the cloud metadata credentials path and see part of the response reflected in the preview.

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 URL preview feature makes the server visit a link you give it to fetch a title and image. If the server can be tricked into visiting internal addresses, it can reach things only the server should see, such as cloud credentials. Here the filter only blocked the obvious localhost name, so a different way of writing the same address slipped through.

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 T4nv1

View all

113 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.