CVE-2022-24066: Simple git Command Injection Vulnerability
HIGHCVE-2022-24066 is a HIGH (CVSS 8.1) command injection vulnerability (CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')) affecting Simple git libraries in the npm ecosystem. The issue involves command injection in simple-git. Remediation is available by upgrading affected packages to version 3.5.0.
CVE-2022-24066 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-24066
To remediate this vulnerability, upgrade all affected Simple git dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install simple-git@3.5.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls simple-git
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-24066, inspect your project dependencies using npm:
npm ls simple-git
Analyze the terminal output to locate any version of Simple git in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.5.0), your application is affected.
Note: The npm ls simple-git command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection'), where the product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string. In Simple git, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-24066 Affected Simple git Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
simple-git
|
npm |
< 3.5.0
|
3.5.0
|
References
Frequently Asked Questions
What is CVE-2022-24066?
Which Simple git versions are affected?
What version fixes CVE-2022-24066?
Is simple-git affected?
What is the CVSS score of CVE-2022-24066?
What CWE is associated with CVE-2022-24066?
How can I check npm dependencies for CVE-2022-24066?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-28xr-mwxg-3qc8",
"modified" : "2022-10-13T15:14:51Z",
"published" : "2022-04-02T00:00:13Z",
"aliases" : [ "CVE-2022-24066" ],
"summary" : "Command injection in simple-git",
"details" : "`simple-git` (maintained as [git-js](https://github.com/steveukx/git-js) named repository on GitHub) is a light weight interface for running git commands in any node.js application.The package simple-git before 3.5.0 are vulnerable to Command Injection due to an incomplete fix of [CVE-2022-24433](https://security.snyk.io/vuln/SNYK-JS-SIMPLEGIT-2421199) which only patches against the git fetch attack vector. A similar use of the --upload-pack feature of git is also supported for git clone, which the prior fix didn't cover. A fix was released in simple-git@3.5.0.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "simple-git"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.5.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24066"
}, {
"type" : "WEB",
"url" : "https://github.com/steveukx/git-js/commit/2040de601c894363050fef9f28af367b169a56c5"
}, {
"type" : "WEB",
"url" : "https://gist.github.com/lirantal/a930d902294b833514e821102316426b"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/steveukx/git-js"
}, {
"type" : "WEB",
"url" : "https://github.com/steveukx/git-js/releases/tag/simple-git%403.5.0"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2434820"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-SIMPLEGIT-2434306"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-88" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-04-04T21:59:51Z",
"nvd_published_at" : "2022-04-01T20:15:00Z"
}
}