All CVEs / Shell-quote Project
CVE-2021-42740Shell-quote Project Shell-quote
Critical 9.8 No auth needed
Follow: this CVE · Shell-quote Project · Shell-quote Project Shell-quote We alert you by email or Slack (account required).
- Priority
- 74
- CVSS 3.1
- 9.8
- EPSS
- 4.1% probability of exploitation in 30 days · percentile 92
- Auth required
- No
- Published
- Oct 21, 2021
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-77
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
What happens
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.
What to do
- Apply the vendor's security update for Shell-quote.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | shell-quote |
≥ 1.6.3 < 1.7.3 |
1.7.3 |
npm install shell-quote@1.7.3 |
Per OSV / GitHub Advisories (GHSA-g4rg-993r-mgx7). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| shell-quote_project | shell-quote | < 1.7.3 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Third Party Advisory
- github.com Patch Third Party Advisory
- www.npmjs.com Vendor Advisory