Shell Command Injection

Affecting git-ls-remote package, versions <0.2.0

Overview

git-ls-remote is an npm package used for listing references in a remote git repository. Vulnerable versions of the package pass the git url argument to the exec function without sanitisation. An attacker can use this to inject malicious shell commands to disrupt server operation or obtain sensitive information.

Example

var git = require('git-ls-remote');
git.head('https://gitrepo.com/; cat /etc/passwd', function(err, result) {
  // ...
});

Remediation

Upgrade git-ls-remote to version 0.2.0 or higher.

References

Do your applications use this vulnerable package?

CVSS Score

10.0
high severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Changed
  • Confidentiality
    High
  • Integrity
    High
  • Availability
    Low
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L
Credit
Snyk Security Research Team
CWE
CWE-78
Snyk ID
npm:git-ls-remote:20160923
Disclosed
22 Sep, 2016
Published
25 Sep, 2016