{"schema_version":"1.9.0","id":"CVE-2021-42740","published":"2021-10-21T15:15:07.633Z","modified":"2026-08-28T14:32:46.129142Z","aliases":["GHSA-g4rg-993r-mgx7"],"related":["CGA-rh74-4xrc-3rv6","SUSE-SU-2022:3313-1","SUSE-SU-2022:3314-1","SUSE-SU-2022:3761-1","SUSE-SU-2023:0592-1"],"details":"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":[{"ranges":[{"type":"GIT","repo":"https://github.com/ljharb/shell-quote","events":[{"introduced":"0"},{"fixed":"6a8a899c62a58a30fb128a7079f02826ed4faee0"}],"database_specific":{"cpe":"cpe:2.3:a:shell-quote_project:shell-quote:*:*:*:*:*:node.js:*:*","extracted_events":[{"introduced":"0"},{"fixed":"1.7.3"}],"source":"CPE_RANGE"}}],"versions":["v1.7.2","v1.7.1","v1.7.0","v1.6.3","v1.6.2","v1.6.1","v1.6.0","v1.5.0","v1.4.3","v1.4.2","v1.4.1","v1.4.0","v1.3.3","v1.3.2","v1.3.1","v1.3.0","v1.2.0","v1.1.0","v1.0.0","v0.1.1","v0.1.0","v0.0.1","v0.0.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-42740.json"}}],"references":[{"type":"ADVISORY","url":"https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md#173"},{"type":"ADVISORY","url":"https://www.npmjs.com/package/shell-quote"},{"type":"FIX","url":"https://github.com/substack/node-shell-quote/commit/5799416ed454aa4ec9afafc895b4e31760ea1abe"}],"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}