NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
CRITICAL severity

CVE-2021-42740 — shell-quote

CRITICALFix: substack/node-shell-quote@5799416

CVE-2021-42740 is a critical-severity (CVSS 9.8) CWE-77 vulnerability in shell-quote. A fix is available for shell-quote — see the affected versions and patch details below.

Improper Neutralization of Special Elements used in a Command in Shell-quote

Also known asGHSA-g4rg-993r-mgx7
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Nov 5, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
4.2%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs91th percentile — riskier than 91% of all scored CVEsHighest risk
2.56%5.22%7.88%10.5%9.0%4.2%May 26Sep 26Nov 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

2Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
shell-quotenpm
96.3Mdownloads / week

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

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmshell-quote≥ 1.6.3&&< 1.7.31.7.3npm install shell-quote@1.7.3

Affected Products

1 product · 1 configurations
Application
shell-quoteshell-quote_project
< 1.7.3
range

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for shell-quote, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update shell-quote to 1.7.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-42740 is resolved across your whole dependency graph.

  3. Workarounds

    Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.

Frequently Asked Questions

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.
O3 Security · Impact-Aware SCA

Is CVE-2021-42740 in your dependencies?

Find it across npm, including transitive dependencies.

CVE-2021-42740: shell-quote — Fixed in 1.7.3