Skip to content
RCE Advisory Beginner CVE-2022-46161

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.

ghsecuritylab Follow

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()).

ghsecuritylab, on GitHub Security Lab

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.

More by ghsecuritylab

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.