GHSA-cff4-rrq6-h78w: Command exists Command Injection Vulnerability

CRITICAL
CWE-77
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-cff4-rrq6-h78w
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
Affected Product Command exists
Package Ecosystem npm
Published Date
Last Updated

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.

command-exists fixed: 1.2.4
npm install command-exists@1.2.4
Verify Direct and Transitive Dependencies

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

Versions of `command-exists` before 1.2.4 are vulnerable to command injection. This is exploitable if user input is provided to this module. ## Recommendation Update to version 1.2.4 or later.

GHSA-cff4-rrq6-h78w Affected Command exists Versions

1 component(s)
Fixed Versions:
1.2.4
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?
GHSA-cff4-rrq6-h78w is a security vulnerability in Command exists involving Command Injection in command-exists under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
Which Command exists versions are affected?
Affected versions include releases prior to 1.2.4 across affected packages: command-exists.
What version fixes GHSA-cff4-rrq6-h78w?
Upgrading to 1.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is command-exists affected?
Yes, command-exists is affected in releases prior to 1.2.4. Upgrade your dependency to 1.2.4 or later.
What CWE is associated with GHSA-cff4-rrq6-h78w?
GHSA-cff4-rrq6-h78w is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') (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.).
How can I check npm dependencies for GHSA-cff4-rrq6-h78w?
Run the dependency tree command: 'npm ls command-exists'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}