The shell-quote package before 1.7.3 for Node.js allows command injection. An attacker can inject unescaped…
Historical advisory recorded 24 Oct 2026 19:17:31 UTC. Read the latest advisory.
nvd · CVE-2021-42740
PublishedThe 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.
Read the publisher's advisoryAffected versions, risk and source history
nvd · CVE-2021-42740
PublishedNVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON.
Source analysis status: Modified
Weakness classifications: CWE-77
Original publisher date fields
published: 2021-10-21T15:15:07.633
lastModified: 2026-06-17T04:10:03.200
1 source CPE criteria · context only
- cpe:2.3:a:shell-quote_project:shell-quote:*:*:*:*:*:node.js:*:*
The original JSON retains the logical configuration operators, exclusions and version bounds.
No normalized affected-package data is projected for this source revision. The original publisher record may contain additional product and version evidence; this does not establish that a package is unaffected.
Original source record · Cite this exact observation · Complete original publisher JSON