CVE-2026-102422
Shell command injection in shell-quote via unvalidated comments
Critical 9.2 No auth needed
Follow: this CVE We alert you by email or Slack (account required).
- Priority
- 70
- CVSS 4.0
- 9.2
- EPSS
- —
- Auth required
- No
- Published
- Sep 29, 2026
- Updated
- Sep 30, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-78
- SSVC (CISA)
- Exploitation: none · Automatable: no · Technical impact: total
- Vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
What happens
The `quote()` function in shell-quote emits comment tokens as `#` followed by text, which comments out the rest of the shell line. A line terminator in a later string ends the comment and the rest is executed as shell input. Attackers can execute arbitrary commands if combining `parse()` output with untrusted strings.
Show the original NVD text
shell-quote's `quote()` function emits a `{ comment }` token as `#` followed by its text, which comments out the rest of the shell line, including the opening quote of any later string token. A line terminator (\n, \r, U+2028, U+2029) in that later string therefore ends the comment, and the rest of the string is parsed as shell input: `quote(['echo', 'ok', { comment: 'x' }, 'a\nid;#'])` runs `id` in sh, bash, dash, ksh and zsh. `parse()` emits a comment token for a `#` in the middle of a word (for example `http://example.com/#frag`), so callers that combine `parse()` output with another untrusted string, such as `quote(parse(untrustedCommand).concat(untrustedArg))`, are affected. The fix for CVE-2026-9277 rejected line terminators in the comment's own text, but not in the tokens after it. Fixed in 1.11.0: `quote()` throws a `TypeError` when a string after a `{ comment }` token contains a line terminator.
What to do
Patch available · fixed versions: 1.11.0
Update shell-quote to version 1.11.0 or later, which rejects line terminators in strings following comment tokens.
- Check whether you run any of the affected products and follow the vendor advisory.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | shell-quote |
≥ 1.8.4 < 1.11.0 |
1.11.0 |
npm install shell-quote@1.11.0 |
Per OSV / GitHub Advisories (GHSA-pqg4-j6r4-53mv). Check the version in your lockfile before upgrading.
Official advisories
- agama-web-ui-25+723.416bea1dc-57.1 on GA media · SUSE · openSUSE-SU-2026:12701-1 · Nov 27, 2026 Critical
- Red Hat Security Advisory: Red Hat Hardened Images RPMs Security Update · Red Hat · RHSA-2026:72498 · Nov 23, 2026 Critical
- Red Hat Security Advisory: Red Hat Hardened Images RPMs Security Update · Red Hat · RHSA-2026:72507 · Nov 23, 2026 Critical
- Red Hat Security Advisory: Red Hat Hardened Images RPMs Security Update · Red Hat · RHSA-2026:72750 · Oct 10, 2026 Critical
Also: Red Hat (+1)
Vendor, CERT and distribution advisories that name this CVE. Original titles.
Official sources
References
Links published by the sources. Open them with care.