Vulnerabilities in pkg:npm/require-node

PACKAGE
Advisory Summary

GHSA-8j6j-4h2c-c65p is a CRITICAL arbitrary code execution vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Require node libraries in the npm ecosystem. The issue involves arbitrary code execution in require-node. Remediation is available by upgrading affected packages to version 1.3.4, 2.0.4.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/require-node

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/require-node. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-8j6j-4h2c-c65p - CRITICAL Arbitrary Code Execution in require-node

GHSA-8j6j-4h2c-c65p at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-8j6j-4h2c-c65p
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Require node
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-8j6j-4h2c-c65p

To remediate this vulnerability, upgrade all affected Require node dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

require-node fixed: 1.3.4
npm install require-node@1.3.4
require-node fixed: 2.0.4
npm install require-node@2.0.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 require-node

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-8j6j-4h2c-c65p, inspect your project dependencies using npm:

npm ls require-node

Analyze the terminal output to locate any version of Require node in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.4), your application is affected.

Note: The npm ls require-node 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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Require node, 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 `require-node` prior to 1.3.4 for 1.x and 2.0.4 for 2.x are vulnerable to Arbitrary Code Execution. The package fails to sanitize requests to the `require-node` endpoint, allowing attackers to execute arbitrary code in the server through the injection of OS commands in the request body. ## Recommendation - If you are using 1.x, upgrade to version 1.3.4 or later. - If you are using 2.x, upgrade to version 2.0.4 or later.

GHSA-8j6j-4h2c-c65p Affected Require node Versions

2 component(s)
Fixed Versions:
1.3.42.0.4
Product / Package Ecosystem Affected Versions Fixed Version
require-node
npm
< 1.3.4
1.3.4
require-node
npm
≥ 2.0.0
< 2.0.4
2.0.4

References

Frequently Asked Questions

What is GHSA-8j6j-4h2c-c65p?
GHSA-8j6j-4h2c-c65p is a security vulnerability in Require node involving Arbitrary Code Execution in require-node under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Require node versions are affected?
Affected versions include releases prior to 1.3.4, 2.0.4 across affected packages: require-node.
What version fixes GHSA-8j6j-4h2c-c65p?
Upgrading to 1.3.4, 2.0.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is require-node affected?
Yes, require-node is affected in releases prior to 1.3.4, 2.0.4. Upgrade your dependency to 1.3.4, 2.0.4 or later.
What CWE is associated with GHSA-8j6j-4h2c-c65p?
GHSA-8j6j-4h2c-c65p is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for GHSA-8j6j-4h2c-c65p?
Run the dependency tree command: 'npm ls require-node'. 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-8j6j-4h2c-c65p",
  "modified" : "2020-08-31T18:44:11Z",
  "published" : "2020-09-03T17:02:52Z",
  "aliases" : [ ],
  "summary" : "Arbitrary Code Execution in require-node",
  "details" : "Versions of `require-node` prior to 1.3.4 for 1.x and 2.0.4 for 2.x are vulnerable to Arbitrary Code Execution. The package fails to sanitize requests to the `require-node` endpoint, allowing attackers to execute arbitrary code in the server through the injection of OS commands in the request body.\n\n\n## Recommendation\n\n- If you are using 1.x, upgrade to version 1.3.4 or later.\n- If you are using 2.x, upgrade to version 2.0.4 or later.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "require-node"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "require-node"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1015"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:44:11Z",
    "nvd_published_at" : null
  }
}