CVE-2021-24033: React dev utils React-dev-utils OS Command Injection Vulnerability
MODERATECVE-2021-24033 is a MODERATE (CVSS 5.6) react-dev-utils os command injection 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 os command injection in function `getprocessforport`. Remediation is available by upgrading affected packages to version 11.0.4.
CVE-2021-24033 at a Glance
Security Impact
CVSS: 5.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2021-24033
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@11.0.4
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-2021-24033, 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 11.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-2021-24033 Affected React dev utils Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
react-dev-utils
|
npm |
≥ 0.4.0
< 11.0.4
|
11.0.4
|
References
Frequently Asked Questions
What is CVE-2021-24033?
Which React dev utils versions are affected?
What version fixes CVE-2021-24033?
Is react-dev-utils affected?
What is the CVSS score of CVE-2021-24033?
What CWE is associated with CVE-2021-24033?
How can I check npm dependencies for CVE-2021-24033?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5q6m-3h65-w53x",
"modified" : "2022-08-03T17:21:06Z",
"published" : "2021-03-11T22:26:09Z",
"aliases" : [ "CVE-2021-24033" ],
"summary" : "react-dev-utils OS Command Injection in function `getProcessForPort`",
"details" : "react-dev-utils prior to v11.0.4 exposes a function, `getProcessForPort`, where an input argument is concatenated into a command string to be executed. This function is typically used from react-scripts (in Create React App projects), where the usage is safe. Only when this function is manually invoked with user-provided values (ie: by custom code) is there the potential for command injection. If you're consuming it from react-scripts then this issue does not affect you.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "react-dev-utils"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.4.0"
}, {
"fixed" : "11.0.4"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-24033"
}, {
"type" : "WEB",
"url" : "https://github.com/facebook/create-react-app/pull/10644"
}, {
"type" : "WEB",
"url" : "https://github.com/facebook/create-react-app/commit/f5e415f3a5b66f07dcc60aba1b445fa7cda97268"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/facebook/create-react-app"
}, {
"type" : "WEB",
"url" : "https://www.facebook.com/security/advisories/cve-2021-24033"
}, {
"type" : "WEB",
"url" : "https://www.huntr.dev/bounties/1-npm-react-dev-utils"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-03-11T22:18:08Z",
"nvd_published_at" : "2021-03-09T01:15:00Z"
}
}