CVE-2026-102422 shell-quote `quote()` command injection via a line terminator in a token after a `{ comment }` token
Attackers can execute arbitrary shell commands by injecting line terminators into strings following comment tokens in shell-quote's quote() function.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-102422?
CVE-2026-102422 is a critical command injection vulnerability in shell-quote, published on 29 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-78
Which versions are affected by CVE-2026-102422?
2 open source packages ship an affected version, including shell-quote.
| Package | Affected | Fixed in |
|---|---|---|
shell-quote npm | From 1.8.4 | 1.11.0 |
shell-quote npm | From 1.8.4 | 1.11.0 |
Linux distribution packages (1)
jaeger Red Hat:hummingbird:1 | All versions | 0:2.20.0-0.11.hum1 |
How do I fix CVE-2026-102422?
Upgrade shell-quote to 1.11.0 or later.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2026-102422 being exploited?
There is no known exploitation of CVE-2026-102422 in the wild and no public exploit code.
Public exploit code: 1 proofs of concept on GitHub.
Sources
Also known as CLEANSTART-2026-SW67186, CLEANSTART-2026-VG90547, CLSA-2026-1790673243, DEBIAN-CVE-2026-102422, ECHO-e4ca-6368-1428, GHSA-pqg4-j6r4-53mv and 7 more.