node-shell-quote — security advisory
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.
- Products
- node-shell-quote
- Affected versions
- Not specified
- Fixed versions
- 1.7.3+~1.7.1-1
- CVEs
- CVE-2021-42740
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 01:22 UTC · Revision 1
Source evidence
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.
osv:DEBIAN-CVE-2021-42740
node-shell-quote
Fixed versions: 1.7.3+~1.7.1-1
node-shell-quote
Fixed versions: 1.7.3+~1.7.1-1
node-shell-quote
Fixed versions: 1.7.3+~1.7.1-1
Complete source record
{
"id": "15b051fb3969e50c2585d1aa64b00cac552793c803a173938f74fcf9d599edd2",
"url": "https://osv.dev/vulnerability/DEBIAN-CVE-2021-42740",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "DEBIAN-CVE-2021-42740",
"summary": "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.",
"evidence": "osv:DEBIAN-CVE-2021-42740",
"products": [
{
"name": {
"value": "node-shell-quote",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "1.7.3+~1.7.1-1",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
},
{
"name": {
"value": "node-shell-quote",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "1.7.3+~1.7.1-1",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
},
{
"name": {
"value": "node-shell-quote",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "1.7.3+~1.7.1-1",
"evidence": "/affected/2/ranges"
}
],
"affected_versions": []
}
],
"severity": "critical",
"structured": {
"id": "DEBIAN-CVE-2021-42740",
"aliases": [
"DEBIAN-CVE-2021-42740"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "1.7.3+~1.7.1-1"
}
]
}
],
"package": {
"name": "node-shell-quote",
"purl": "pkg:deb/debian/node-shell-quote?arch=source&distro=bookworm",
"ecosystem": "Debian:12"
},
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-42740.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "1.7.3+~1.7.1-1"
}
]
}
],
"package": {
"name": "node-shell-quote",
"purl": "pkg:deb/debian/node-shell-quote?arch=source&distro=trixie",
"ecosystem": "Debian:13"
},
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-42740.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "1.7.3+~1.7.1-1"
}
]
}
],
"package": {
"name": "node-shell-quote",
"purl": "pkg:deb/debian/node-shell-quote?arch=source&distro=forky",
"ecosystem": "Debian:14"
},
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2021-42740.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
}
],
"modified": "2026-10-23T18:04:39.147890730Z",
"provider": "osv",
"upstream": [
"CVE-2021-42740"
],
"references": [
"https://security-tracker.debian.org/tracker/CVE-2021-42740"
]
},
"related_cves": [
{
"value": "CVE-2021-42740",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 423622,
"published_at": "2021-10-21T15:15:07.633+00:00"
}