Skip to content
SSRF Write-up Intermediate

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.

Codi Follow

Published on medium.com

My server was asking Amazon for sensitive credentials, and it was all because of a PDF button.

Codi, on medium.com

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

  1. Submit a certificate request with a title containing simple HTML tags.
  2. Observe that the generated PDF renders the HTML (e.g. italic text).
  3. Inject an iframe pointing to an external server and confirm the target server makes a request to it.
  4. Inject an iframe pointing to the AWS metadata endpoint and read the metadata paths in the PDF.
  5. 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.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.