CVE-2026-102422: shell-quote quote() function code injection in comment handling

CVE-2026-102422 · Severity: high · CVSS 8.1 · Published 2026-09-29

shell-quote is a Node.js library for parsing and quoting shell command strings. The quote() function improperly handles comment tokens, allowing attackers to inject shell commands when comments are combined with untrusted strings containing line terminators. This can lead to arbitrary command execution on systems using the library to construct shell commands.

Technologies: shell-quote (npm). Vendors: npm.

Quick answers

Is CVE-2026-102422 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-102422 being exploited in the wild.
How severe is CVE-2026-102422?
High severity, with a CVSS score of 8.1, published 29 September 2026.
Which products and versions are affected?
Ljharb Shell-Quote before 1.11.0; shell-quote (npm) >= 1.8.4, < 1.11.0, SEMVER:introduced=1.8.4,fixed=1.11.0.
Is there a fix for CVE-2026-102422?
Yes. shell-quote (npm): upgrade to 1.11.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-102422 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-102422?
Check whether you run Ljharb Shell-Quote or shell-quote (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • shell-quote (npm): upgrade to 1.11.0 or later
    npm install shell-quote@1.11.0

Technical details

The quote() function emits comment tokens as `#` followed by text, which comments out the rest of the shell line. When a string token containing a line terminator (\n, \r, U+2028, U+2029) appears after a comment token, the line terminator ends the comment and the remaining string is parsed as shell input, enabling command injection. The vulnerability affects code combining parse() output with untrusted input, such as quote(parse(untrustedCommand).concat(untrustedArg)).

Affected products

  • ljharb shell-quote before 1.11.0

Identifiers

  • CVE-2026-102422
  • GHSA-pqg4-j6r4-53mv

Timeline

  • 2026-09-29: disclosed
  • 2026-09-29: patched: Fixed in version 1.11.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.