Quick answers
- Is CVE-2021-42740 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2021-42740 being exploited in the wild.
- How severe is CVE-2021-42740?
- Low severity, with a CVSS score of 3.1, published 24 May 2022.
- Which products and versions are affected?
- shell-quote (npm) 1.6.3 through 1.7.2.
- Is there a fix for CVE-2021-42740?
- A patch was published on 2022-05-24: Advisory GHSA-g4rg-993r-mgx7 published with fix in version 1.7.3 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2021-42740 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2021-42740?
- Check whether you run shell-quote (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
Technical details
shell-quote contains an Improper Neutralization of Special Elements vulnerability (CWE-77) in its Windows drive letter detection regex. The regex uses [A-z] instead of the correct [A-Za-z], which fails to exclude shell metacharacters (such as backticks, brackets, and other characters) in the ASCII range between uppercase Z and lowercase a. If attacker-controlled input is passed to the quote function and the output is subsequently used in exec() or similar shell execution, arbitrary commands can be executed. The vulnerability was introduced in version 1.6.3 and fixed in version 1.7.3. No authentication or user interaction is required; network-reachable applications that process untrusted input through shell-quote are at risk.
Affected products
- npm shell-quote 1.6.3 through 1.7.2
Identifiers
- CVE-2021-42740
- GHSA-g4rg-993r-mgx7
Timeline
- 2021-10-21: disclosed: CVE-2021-42740 published on NVD
- 2022-05-24: patched: Advisory GHSA-g4rg-993r-mgx7 published with fix in version 1.7.3
- 2022-06-21: other: GitHub security review completed