Skip to content
Info disclosure Write-up Intermediate

Playing Hide And Seek With Pdf Files

The export PDF feature accepted arbitrary HTML from the client and converted it to PDF on the server without sanitisation. An attacker could inject an iframe pointing to a local file path, causing the server to embed the file's contents in the PDF and disclose it.

jmp2esp Follow

Published on infosecwriteups.com

I was testing a website when I found an export PDF functionality. Recently I learned about PDF export injection vulnerability, so this was perfect to test something new!

jmp2esp, on infosecwriteups.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 server-side HTML-to-PDF library was used without disabling local file access, as warned in its security recommendations.

Impact

An attacker could read any file on the server that the process has access to, as long as the path and filename are known or guessed.

What the attacker needed

Access to the export PDF feature; knowledge of the target file path

How it was found

  1. Find the export PDF feature and observe that the HTML content is sent from the client.
  2. Inject an iframe pointing to a local file path in the HTML.
  3. Send the request and download the resulting PDF.
  4. Open the PDF to see the file contents.

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 let users turn HTML into a PDF file. The server did not check what HTML it was given, so an attacker could tell it to include a local file, like a system file, in the PDF. This let the attacker read files on the server.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.