From a Simple Certificate to a Critical Cloud Flaw: A Bug Bounty
A PDF certificate generator did not sanitise the title field, allowing HTML injection. The injected HTML was rendered by a headless browser, which fetched external resources, enabling SSRF to the AWS metadata endpoint and exposure of temporary IAM credentials.
My server was asking Amazon for sensitive credentials, and it was all because of a PDF button.
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 user-supplied HTML in a headless browser without sanitising it, so injected tags caused server-side requests.
Impact
An attacker could obtain temporary AWS credentials, potentially leading to cloud account compromise, though the text does not state what actions were possible with them.
What the attacker needed
Access to the certificate feature; ability to submit a title field; server-side PDF rendering with external fetch
The fix
The vendor addressed the flaw and the credentials were rotated; more generally, inputs should be sanitised for all downstream uses, including PDF generators.
How it was found
- Submit a certificate request with a title containing simple HTML tags.
- Observe that the generated PDF renders the HTML (e.g. italic text).
- Inject an iframe pointing to an external server and confirm the target server makes a request to it.
- Inject an iframe pointing to the AWS metadata endpoint and read the metadata paths in the PDF.
- Access the IAM role credentials endpoint and read the temporary AWS keys from the PDF.
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 PDF generator takes your input and turns it into a document. If it does not clean the input, an attacker can insert HTML that makes the server fetch other web pages. Here, that let the attacker ask the cloud provider for 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.