GHSA-8j6j-4h2c-c65p: Require node Arbitrary Code Execution Vulnerability
CRITICALGHSA-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.
GHSA-8j6j-4h2c-c65p at a Glance
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.
npm install require-node@1.3.4
npm install require-node@2.0.4
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
GHSA-8j6j-4h2c-c65p Affected Require node Versions
2 component(s)| 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?
Which Require node versions are affected?
What version fixes GHSA-8j6j-4h2c-c65p?
Is require-node affected?
What CWE is associated with GHSA-8j6j-4h2c-c65p?
How can I check npm dependencies for GHSA-8j6j-4h2c-c65p?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}