SSRF Symphony: How I Turned a PDF Generator Into an Internal Net
A PDF export service rendered user-supplied HTML and fetched external images, allowing blind SSRF. The attacker used command substitution to exfiltrate AWS IAM credentials via DNS and scanned internal ports, potentially compromising cloud access.
Free Link🎈
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 generator rendered untrusted HTML and fetched external resources without restricting outbound requests to internal networks.
Impact
The attacker obtained AWS credentials and mapped internal services, potentially leading to full cloud access and further infrastructure breach.
What the attacker needed
Access to PDF export feature; Attacker-controlled domain; PDF generator can reach internal network
The fix
The service should sanitise HTML, block external resource requests, restrict outbound network access, and use IMDSv2.
How it was found
- Observe the PDF export request and the separate PDF generation service.
- Inject an image tag pointing to an attacker-controlled server and confirm the PDF generator makes an outbound request.
- Use command substitution in the image URL to run curl against the AWS metadata endpoint and encode the result in a DNS subdomain.
- Capture the DNS query containing the IAM role name, then repeat to exfiltrate credentials.
- Scan internal ports using response time differences to find open services like Consul.
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 PDF generator fetched images from any URL given in the HTML, including internal addresses. The attacker made it fetch secret cloud credentials and send them out via DNS lookups. This is called SSRF: tricking a server into making requests on your behalf.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.