How I Hacked Google’s Servers (Legally) With One URL
An image-fetching API concatenated user input onto a base URL, causing a limited SSRF that only allowed DNS lookups. By registering a matching subdomain with a valid certificate and using an open redirect, the attacker could reach internal HTTP services and the cloud metadata endpoint.
I was testing a Google service that allowed users to customize blog layouts. There was a simple API that fetched images.
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
Impact
The chain could reach internal administrative interfaces and the cloud metadata service, potentially exposing credentials and configuration data, and the cached script could run in another user's session, suggesting an account takeover path.
What the attacker needed
Control of a domain and subdomain; valid TLS certificate for that subdomain; ability to host files and a redirect script
The fix
The vulnerability was fixed after the report was validated.
How it was found
- Change the path parameter to start with a dot and your own domain, causing a DNS lookup to your server.
- Register a subdomain matching the expected pattern and set up a valid certificate so the HTTPS fetch succeeds.
- Host an HTML page with JavaScript on your domain and trigger the API to fetch and cache it.
- Host a redirect script on your trusted domain and call the API with a path pointing to it, redirecting to an internal HTTP address.
- Use the redirect to request the cloud metadata endpoint and internal IP addresses.
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 website had a feature that fetched images from a web address you could partly control. Because it glued your text onto its own address without checking, you could make its server visit other places, including internal machines and a cloud service that holds secret keys.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.