SSRF via filename -> PDF Extractor (via SMTP), detailed shi- write-up
A ticketing system that converts emails and attachments to PDF rendered attacker-controlled HTML from an attachment filename without sanitisation. An attacker could embed an iframe pointing at internal addresses, causing the server-side PDF converter to fetch them and disclose the response in the generated PDF.
Published on medium.com
Okay 1st things 1st, what I’ll talk about is not only just vuln discovery steps,
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 exporter (wkhtmltopdf/WebKit) rendered unsanitised HTML taken from the attachment filename, so injected tags such as iframes were executed server-side.
What the attacker needed
Ability to email the ticketing system; victim or attacker triggers PDF export
How it was found
- Send an email to the ticketing system with an attachment whose filename contains HTML markup.
- Open the ticket and use the 'Export as PDF' feature.
- Observe that the injected HTML, such as an iframe, is rendered in the resulting 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.
When you export something as a PDF, the server often builds a web page first and then prints it. Here the server took text from an email attachment's filename and put it into that page without cleaning it, so the attacker's HTML ran on the server. That let the attacker make the server fetch internal web addresses and show the results back in the PDF.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.