GHSA-cff4-rrq6-h78w: Command exists Command Injection Vulnerability
CRITICALGHSA-cff4-rrq6-h78w is a CRITICAL command injection vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting Command exists libraries in the npm ecosystem. The issue involves command injection in command-exists. Remediation is available by upgrading affected packages to version 1.2.4.
GHSA-cff4-rrq6-h78w at a Glance
How to Fix GHSA-cff4-rrq6-h78w
To remediate this vulnerability, upgrade all affected Command exists 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 command-exists@1.2.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls command-exists
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-cff4-rrq6-h78w, inspect your project dependencies using npm:
npm ls command-exists
Analyze the terminal output to locate any version of Command exists in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.4), your application is affected.
Note: The npm ls command-exists 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-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. In Command exists, 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
GHSA-cff4-rrq6-h78w Affected Command exists Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
command-exists
|
npm |
< 1.2.4
|
1.2.4
|
References
Frequently Asked Questions
What is GHSA-cff4-rrq6-h78w?
Which Command exists versions are affected?
What version fixes GHSA-cff4-rrq6-h78w?
Is command-exists affected?
What CWE is associated with GHSA-cff4-rrq6-h78w?
How can I check npm dependencies for GHSA-cff4-rrq6-h78w?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cff4-rrq6-h78w",
"modified" : "2020-08-31T18:31:41Z",
"published" : "2019-06-03T17:31:26Z",
"aliases" : [ ],
"summary" : "Command Injection in command-exists",
"details" : "Versions of `command-exists` before 1.2.4 are vulnerable to command injection. This is exploitable if user input is provided to this module.\n\n\n## Recommendation\n\nUpdate to version 1.2.4 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "command-exists"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mathisonian/command-exists/commit/7ca91ba71604df6817a28c93d7776af9c49c431a"
}, {
"type" : "WEB",
"url" : "https://hackerone.com/reports/324453"
}, {
"type" : "WEB",
"url" : "https://github.com/mathisonian/command-exists/blob/v1.2.2/lib/command-exists.js#L49-L94"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/659"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-77" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2019-06-03T17:28:56Z",
"nvd_published_at" : null
}
}