When an Internal IP Slipped — and I Slid Right Into RCE
A PDF generation API accepted a user-supplied URL and fetched it server-side, allowing SSRF. The attacker used this to reach the cloud metadata endpoint and steal AWS credentials, and also to access an internal service that was vulnerable to remote code execution.
medium.com
Published on medium.com
It was a chill evening, and I was half-heartedly poking around a Bug Bounty target. Burp Suite was running, Spotify was playing, and I was testing file upload features, contact forms, and those random “lookup” APIs that developers seem to love.
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 PDF generation service did not validate or restrict the URLs it fetched, allowing requests to internal and metadata addresses.
Impact
The attacker could steal AWS credentials and achieve remote code execution on an internal service, potentially leading to full compromise of the cloud environment.
What the attacker needed
Access to the PDF generation API; ability to supply a URL parameter
How it was found
- Submit a URL pointing to a Burp Collaborator domain to the PDF generation API.
- Observe a DNS and HTTP interaction from the server, confirming SSRF.
- Change the URL to internal addresses such as localhost, cloud metadata, and private IPs.
- Access the cloud metadata endpoint to retrieve IAM credentials.
- Access an internal service and fuzz a parameter to achieve remote code execution.
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 took a web address and turned it into a PDF. The server fetched that address without checking it, so the attacker could make it fetch internal addresses that are normally hidden. This let the attacker read cloud credentials and run commands on an internal machine.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.