Command Injection Affecting gfc package, versions *


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team

    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-GFC-1023302
  • published 28 Oct 2020
  • disclosed 27 Oct 2020
  • credit d3lla

Introduced: 27 Oct 2020

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

How to fix?

There is no fixed version for gfc.

Overview

gfc is a Simple way to initialize a new git repository in an empty directory, add a file and do a first commit (or skip that part in a directory with files). Useful for unit tests and generators.

Affected versions of this package are vulnerable to Command Injection via the options argument which is used to build the command that is passed to the child_process.exec function without any sanitization.

POC

const firstCommit = require('gfc');
const options = {message: '""; touch HACKED;'};
firstCommit('.', options, function(err) {});

References

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
9.8 critical
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    High