CVE-2018-6342: React dev utils Remote Code Execution Vulnerability
HIGHCVE-2018-6342 is a HIGH remote code execution vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting React dev utils libraries in the npm ecosystem. The issue involves react-dev-utils on windows vulnerable to remote code execution. Remediation is available by upgrading affected packages to version 1.0.4, 2.0.2, 3.1.2, 4.2.2, 5.0.2.
CVE-2018-6342 at a Glance
How to Fix CVE-2018-6342
To remediate this vulnerability, upgrade all affected React dev utils 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 react-dev-utils@1.0.4
npm install react-dev-utils@2.0.2
npm install react-dev-utils@3.1.2
npm install react-dev-utils@4.2.2
npm install react-dev-utils@5.0.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls react-dev-utils
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2018-6342, inspect your project dependencies using npm:
npm ls react-dev-utils
Analyze the terminal output to locate any version of React dev utils in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.4), your application is affected.
Note: The npm ls react-dev-utils 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 React dev utils, 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-2018-6342 Affected React dev utils Versions
5 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
react-dev-utils
|
npm |
≥ 1.0.0
< 1.0.4
|
1.0.4
|
|
react-dev-utils
|
npm |
≥ 2.0.0
< 2.0.2
|
2.0.2
|
|
react-dev-utils
|
npm |
≥ 3.0.0
< 3.1.2
|
3.1.2
|
|
react-dev-utils
|
npm |
≥ 4.0.0
< 4.2.2
|
4.2.2
|
|
react-dev-utils
|
npm |
≥ 5.0.0
< 5.0.2
|
5.0.2
|
References
Frequently Asked Questions
What is CVE-2018-6342?
Which React dev utils versions are affected?
What version fixes CVE-2018-6342?
Is react-dev-utils affected?
What CWE is associated with CVE-2018-6342?
How can I check npm dependencies for CVE-2018-6342?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-29gp-92wp-94q8",
"modified" : "2022-08-03T19:36:45Z",
"published" : "2019-01-04T17:41:20Z",
"aliases" : [ "CVE-2018-6342" ],
"summary" : "react-dev-utils on Windows vulnerable to Remote Code Execution",
"details" : "`react-dev-utils` on Windows is vulnerable to remote code execution.\n\n\n## Recommendation\n\nUpdate to one of the following versions, depending on the release line that you are using.\n- 1.0.4\n- 2.0.2\n- 3.1.2\n- 4.2.2\n- 5.0.2\n- 6.0.0-next.a671462c",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "react-dev-utils"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.0.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "react-dev-utils"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.0.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "react-dev-utils"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.1.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "react-dev-utils"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"fixed" : "4.2.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "react-dev-utils"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0"
}, {
"fixed" : "5.0.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-6342"
}, {
"type" : "WEB",
"url" : "https://github.com/facebook/create-react-app/pull/4866"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-29gp-92wp-94q8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/facebook/create-react-app"
}, {
"type" : "WEB",
"url" : "https://github.com/facebook/create-react-app/releases/tag/v1.1.5"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/695"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T20:51:46Z",
"nvd_published_at" : "2018-12-31T22:29:00Z"
}
}