GHSL-2022-068: Remote Code Execution (RCE) in PDFMake - CVE-2022-46161
The dev-playground server's /pdf endpoint passed user-supplied content directly to eval() without sanitisation or sandboxing. An attacker could execute arbitrary code on the server, leading to remote code execution or resource exhaustion.
Originally disclosed on GitHub Security Lab
The dev-playground of pdfmake lacks sandboxing/sanitization of the data sent to the server (which flows to eval()).
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The /pdf endpoint passed unsanitised user input directly to eval() without sandboxing.
Impact
This could lead to remote code execution or uncontrolled resource consumption.
What the attacker needed
Access to the dev-playground 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 report has not been written yet. The Original tab links to the source.
The pdfmake project includes a small test server that lets you send JavaScript code to generate a PDF. The server ran that code directly on the machine without any checks, so anyone who could reach it could run their own commands, like reading files. This is dangerous because the server trusts whatever code it receives.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.