The shell-quote package before 1.7.3 for Node.js allows command injection.
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-77.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | — | all versions | — | No fix listed | CNA |
| — | shell-quote (npm) | 1.6.3 to before 1.7.3 | 1.7.3 | Patch available | GHSA-g4rg-993r-mgx7 |
- — Vendor— Affected all versions Fixed in — No fix listed CNA
- shell-quote (npm) Vendor— Affected 1.6.3 to before 1.7.3 Fixed in 1.7.3 Patch available GHSA-g4rg-993r-mgx7
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:shell-quote_project:shell-quote:*:*:*:*:*:node.js:*:* | before 1.7.3 | Vulnerable | Shell-quote Project |
- cpe:2.3:a:shell-quote_project:shell-quote:*:*:*:*:*:node.js:*:* Versions before 1.7.3 Vulnerable ·Shell-quote Project
Remediation
- Fix · GHSA-g4rg-993r-mgx7 shell-quote (npm) Fixed in 1.7.3 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2021-42740
- 2026-10-03 Alias added: GHSA-g4rg-993r-mgx7
References
Advisory 3
More Shell-quote Project Shell-quote vulnerabilities
- TI-2026-11280 shell-quote parse() is quadratic in token count, enabling denial of service CVSS 4.0HIGH 8.7
- TI-2016-08583 OS command injection in HackerOne shell-quote node module CVSS 3.1CRITICAL 9.8
Sources
- CVE-2021-42740 · CVE Program
- CVE-2021-42740 · NVD
- FIRST EPSS
- GHSA-g4rg-993r-mgx7 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences