Vulnerabilities / CVE-2021-42740

critical

CVE-2021-42740

The shell-quote package before 1.7.3 for Node.js allows command inject ...

Published Modified CWE 77
In the Trivy database since at least 24 Oct 2026, 07:11 UTCWhen it arrived before that build is not recorded.

Severity by source

NVD9.8CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GHSA9.8CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Trivy's own label is CRITICAL. Rated critical by NVD, GHSA. Rated lower by Ubuntu (medium).

Description

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.

Affected packages and fixed versions

SourcePackageFixed in
npm::GitHub Security Advisory npmshell-quote1.7.3
chainguardjitsucom-jitsu, py3-captum0 and 1 more
debian 12node-shell-quote1.7.3+~1.7.1-1
debian 13node-shell-quote1.7.3+~1.7.1-1
debian 14node-shell-quote1.7.3+~1.7.1-1
echonode-shell-quote1.7.3+~1.7.1-1
ubuntu 18.04-ESMnode-shell-quoteno fix listed
wolfijitsucom-jitsu0
Show all 9 entries from 8 sources
SourcePackageFixed in
npm::GitHub Security Advisory npmshell-quote1.7.3
chainguardjitsucom-jitsu0
chainguardpy3-captum0.9.0-r1
debian 12node-shell-quote1.7.3+~1.7.1-1
debian 13node-shell-quote1.7.3+~1.7.1-1
debian 14node-shell-quote1.7.3+~1.7.1-1
echonode-shell-quote1.7.3+~1.7.1-1
ubuntu 18.04-ESMnode-shell-quoteno fix listed
wolfijitsucom-jitsu0

References

Vulnerability data compiled from the Trivy vulnerability database (trivy-db, Aqua Security, Apache License 2.0), which aggregates third-party advisories. CVE records are published by The MITRE Corporation under the CVE Terms of Use; CVE is a trademark of MITRE. This product uses data from the NVD API but is not endorsed or certified by the NVD. Severity, titles and advisory data from the GitHub Advisory Database (CC BY 4.0), Red Hat security data (CC BY 4.0) and the other sources linked on each entry. Entries may be summarised or re-formatted; the linked original is the authoritative record.