{"id":"CVE-2021-42740","published":"2021-10-21T14:46:08Z","modified":"2024-08-04T03:38:50Z","title":"The shell-quote package before 1.7.3 for Node.js allows command injection","vendor":null,"product":null,"tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.04107,"percentile":0.91006,"provenance":"source"},"cwes":[],"references":[{"url":"https://www.npmjs.com/package/shell-quote","tags":["x_refsource_MISC"]},{"url":"https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md#173","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/substack/node-shell-quote/commit/5799416ed454aa4ec9afafc895b4e31760ea1abe","tags":["x_refsource_CONFIRM"]}],"priority":{"score":18.2,"factors":[{"name":"EPSS percentile","points":18.2}]},"affected":[{"ecosystem":"npm","package":"shell-quote","vulnerableRanges":[">=1.6.3, <1.7.3"],"patched":["1.7.3"],"from":["GHSA-g4rg-993r-mgx7"],"provenance":"source"}],"summary":{"text":"The shell-quote package for Node.js, before version 1.7.3, contains a command injection flaw caused by an incorrect character class in a regex meant to handle Windows drive letters, which uses {A-z] instead of {A-Za-z]. An attacker who can supply input that passes through this package's output into a real shell as a quoted argument to exec() can inject arbitrary commands by using metacharacters such as the backtick, which fall in the range between \"Z\" and \"a\".","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:20:51Z"},"euvd":{"id":"EUVD-2022-3886","exploited":false,"provenance":"source"}}