cve.bz

CVE-2021-42740 shell-quote project shell-quote

9.8 criticalEPSS 4.1%Fix available

Critical (9.8) in shell-quote project shell-quote. EPSS 4.1% estimated probability of exploitation activity in the next 30 days. Fixed in shell-quote 1.7.3.

On this page
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.

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
4.1% (unchanged from 4.2% a week ago; 4.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 91st percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-77 Improper Neutralization of Special Elements used in a Command
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-42740 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-42740?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-42740?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-42740 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
shell-quote_project:shell-quotebefore 1.7.3

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-g4rg-993r-mgx7npmshell-quote>=1.6.3 <1.7.31.7.3

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14node-shell-quote1.7.3+~1.7.1-1DEBIAN-CVE-2021-42740
UbuntuPro:18.04:LTSnode-shell-quoteno fix listedUBUNTU-CVE-2021-42740
SUSEManager Proxy 4.2, Manager Retail Branch Server 4.2release-notes-susemanager-proxy4.2.9-150300.3.43.1SUSE-SU-2022:3313-1
SUSEManager Proxy 4.3, Manager Retail Branch Server 4.3release-notes-susemanager-proxy4.3.2-150400.3.9.3SUSE-SU-2022:3761-1
SUSEManager Proxy Module 4.2mgr-daemon4.2.10-150300.2.9.4SUSE-SU-2022:3314-1
SUSEManager Proxy Module 4.2spacewalk-proxy4.2.12-150300.3.21.3SUSE-SU-2022:3314-1
SUSEManager Proxy Module 4.2spacewalk-proxy4.2.13-150300.3.24.2SUSE-SU-2023:0592-1
SUSEManager Proxy Module 4.2spacewalk-proxy-installer4.2.11-150300.3.14.2SUSE-SU-2023:0592-1
SUSEManager Proxy Module 4.2susemanager-tftpsync-recv4.2.5-150300.3.6.2SUSE-SU-2022:3314-1
SUSEManager Proxy Module 4.2, Manager Server Module 4.2mgr-osad4.2.9-150300.2.12.2SUSE-SU-2023:0592-1
SUSEManager Proxy Module 4.2, Manager Server Module 4.2patterns-suse-manager4.2-150300.4.12.2SUSE-SU-2022:3314-1
SUSEManager Proxy Module 4.2, Manager Server Module 4.2rhnlib4.2.7-150300.4.12.2SUSE-SU-2023:0592-1
SUSEManager Proxy Module 4.2, Manager Server Module 4.2spacecmd4.2.19-150300.4.27.2SUSE-SU-2022:3314-1
SUSEManager Proxy Module 4.2, Manager Server Module 4.2spacecmd4.2.21-150300.4.33.2SUSE-SU-2023:0592-1
49 more for SUSE in the JSON and on SUSE's page.

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE.

Attack patterns (CAPEC)

  • CAPEC-15 Command Delimiters Likelihood: High · Severity: High
  • CAPEC-40 Manipulating Writeable Terminal Devices Likelihood: High · Severity: Very High
  • CAPEC-43 Exploiting Multiple Input Interpretation Layers Likelihood: Medium · Severity: High
  • CAPEC-75 Manipulating Writeable Configuration Files Likelihood: High · Severity: Very High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-136 LDAP Injection Likelihood: High · Severity: High
  • CAPEC-183 IMAP/SMTP Command Injection Severity: Medium
  • CAPEC-248 Command Injection Likelihood: Medium · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON