{"id":"UBUNTU-CVE-2021-42740","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.","modified":"2026-06-09T13:00:08.386107689Z","published":"2021-10-21T15:15:00Z","upstream":["CVE-2021-42740"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2021-42740"},{"type":"REPORT","url":"https://github.com/substack/node-shell-quote/commit/5799416ed454aa4ec9afafc895b4e31760ea1abe"},{"type":"REPORT","url":"https://www.npmjs.com/package/shell-quote"},{"type":"REPORT","url":"https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md#173"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2021-42740"}],"affected":[{"package":{"name":"node-shell-quote","ecosystem":"Ubuntu:Pro:18.04:LTS","purl":"pkg:deb/ubuntu/node-shell-quote?arch=source&distro=esm-apps%2Fbionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.6.1+20160617-git72fb5a8ce29b-1","1.6.1+20160617-git72fb5a8ce29b-1ubuntu0.1~esm1"],"ecosystem_specific":{"binaries":[{"binary_name":"node-shell-quote","binary_version":"1.6.1+20160617-git72fb5a8ce29b-1ubuntu0.1~esm1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-42740.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]}