Data Exfiltration through Blind XXE on PDF Generator
A PDF generator used a vulnerable XML parser (PDFreactor before 10.1.1) that allowed blind XXE injection. An attacker with a low-privileged account could exfiltrate local files such as /etc/passwd by sending crafted XML in the htmlBody parameter, bypassing a firewall that only allowed outbound port 443.
Published on arben.sh
In this post, I will explain how I found a Blind XXE injection on PDF Generator that was vulnerable to CVE-2019-12154. However, in order to exfilftrate data, I had to bypass some WAF restrictions.
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 PDFreactor XML parser was configured to resolve external entities and DTDs, allowing file reads and outbound connections.
What the attacker needed
A low-privileged account; two attacker-controlled servers with public IPs; ability to intercept and modify requests
The fix
The text recommends keeping software up to date and having proper WAF rules in place; upgrading PDFreactor to version 10.1.1 or later would also fix the underlying vulnerability.
How it was found
- Set up two attacker-controlled servers: one HTTP server hosting a malicious DTD file and one FTP server listening on port 443.
- Log in with a low-privileged account and navigate to the report generation page.
- Intercept the PDF download request and replace the htmlBody parameter with XML that references the external DTD.
- Send the request; the server fetches the DTD, reads /etc/passwd, and sends its contents to the FTP server.
- Observe the exfiltrated data arriving on the FTP server.
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.
XML allows documents to define 'entities' that pull in content from elsewhere. If a parser is badly configured, it will fetch a file from the server's own disk or contact an attacker's server. Here the PDF generator did that, so the attacker could read files on the server and send their contents out through a hidden channel.
What is XXE?
An XML parser resolves entities the attacker defines, reading local files or making the server send requests.