Command Injection Affecting gfc package, versions *


Severity

Recommended
0.0
critical
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 Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-GFC-1023302
  • published28 Oct 2020
  • disclosed27 Oct 2020
  • creditd3lla

Introduced: 27 Oct 2020

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