Arbitrary Command Injection Affecting node-shell-quote package, versions <1.7.3+~1.7.1-1


Severity

Recommended
0.0
critical
0
10

Snyk's Security Team recommends NVD's CVSS assessment. Learn more

Threat Intelligence

EPSS
4.22% (91st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-ECHOLATEST-NODESHELLQUOTE-20335173
  • published30 Sept 2026
  • disclosed21 Oct 2021

Introduced: 21 Oct 2021

CVE-2021-42740  (opens in a new tab)
CWE-77  (opens in a new tab)

How to fix?

Upgrade Echo:latest node-shell-quote to version 1.7.3+~1.7.1-1 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream node-shell-quote package and not the node-shell-quote package as distributed by Echo. See How to fix? for Echo:latest relevant fixed versions and status.

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.

CVSS Base Scores

version 3.1