How I Used SSRF to Gain Admin Access: Step-by-Step with Payloads
A URL preview endpoint fetched user-supplied URLs without restricting internal addresses, allowing the attacker to reach an internal admin panel. The attacker could view user data, export reports, access API keys, and modify configuration settings.
medium.com
Published on medium.com
It started with a coffee-fueled recon session on a bug bounty target. A relatively simple app with a few features, nothing flashy.
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 URL preview feature accepted arbitrary user-supplied URLs and made server-side requests without validating or restricting destinations to internal or private addresses.
Impact
The attacker could view user data, export CSV reports, access API keys in plaintext, and modify configuration settings.
What the attacker needed
Access to the URL preview endpoint; no authentication required for the endpoint
The fix
The feature should validate and allowlist URLs, block internal IP ranges, use metadata proxies, segment internal networks, and monitor internal requests.
How it was found
- Send a request to the preview endpoint with a URL pointing to localhost to test for SSRF.
- Send a request with the cloud metadata address to see if internal requests are made.
- Use an automated tool to scan internal IPs and services.
- Try different encodings of localhost to bypass filters.
- Access the internal admin endpoint that returned 200 OK.
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 had a feature that fetched a web page for you to show a preview. The server did the fetching, and it did not check whether the address pointed to its own private network. So the attacker asked it to fetch an internal admin page, and the server returned it.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.