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.
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.
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
- Send a normal external URL to the preview endpoint and confirm it fetches metadata.
- Send an invalid domain and observe a timeout, showing the server really makes the request.
- Send localhost and [redacted] and see them blocked.
- Send the decimal-encoded form of [redacted] and see the block no longer applies.
- Point the feature at an attacker-controlled server and confirm the hit in the logs.
- 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.