Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS1nNHJnLTk5M3ItbWd4N84AAqZr
Improper Neutralization of Special Elements used in a Command in Shell-quote
The shell-quote package before 1.7.3 for Node.js allows command injection. An attacker can inject unescaped shell metacharacters through a regex designed to support Windows drive letters. If the output of this package is passed to a real shell as a quoted argument to a command with exec()
, an attacker can inject arbitrary commands. This is because the Windows drive letter regex character class is [A-z]
instead of the correct [A-Za-z]
. Several shell metacharacters exist in the space between capital letter Z and lower case letter a, such as the backtick character.
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1nNHJnLTk5M3ItbWd4N84AAqZr
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Critical
Classification: General
Published: over 2 years ago
Updated: 12 months ago
CVSS Score: 9.8
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS Percentage: 0.00658
EPSS Percentile: 0.79528
Identifiers: GHSA-g4rg-993r-mgx7, CVE-2021-42740
References:
- https://nvd.nist.gov/vuln/detail/CVE-2021-42740
- https://www.npmjs.com/package/shell-quote
- https://github.com/ljharb/shell-quote/commit/5799416ed454aa4ec9afafc895b4e31760ea1abe
- https://github.com/ljharb/shell-quote/blob/master/CHANGELOG.md#173
- https://github.com/advisories/GHSA-g4rg-993r-mgx7
Blast Radius: 62.4
Affected Packages
npm:shell-quote
Dependent packages: 1,586Dependent repositories: 2,355,456
Downloads: 75,062,852 last month
Affected Version Ranges: <= 1.7.2
Fixed in: 1.7.3
All affected versions: 0.0.0, 0.0.1, 0.1.0, 0.1.1, 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.7.0, 1.7.1, 1.7.2
All unaffected versions: 1.7.3, 1.7.4, 1.8.0, 1.8.1, 1.8.2