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

Source: https://junglewise.ai/threats/cve-2026-102422-shell-quote-s-quote-function-emits-a-comment-token-as-followed  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-09-29. Updated: 2026-09-29  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/shell-quote). Vendors: [npm](https://junglewise.ai/threats/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

  ```sh
  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

- [https://www.npmjs.com/package/shell-quote](https://www.npmjs.com/package/shell-quote)
- [https://github.com/ljharb/shell-quote](https://github.com/ljharb/shell-quote)

## Related threats

- [ljharb shell-quote Denial of Service in parse function](https://junglewise.ai/threats/cve-2026-13311-ljharb-shell-quote-denial-of-service-in-parse-function)
- [ljharb shell-quote command injection in quote function](https://junglewise.ai/threats/cve-2026-9277-ljharb-shell-quote-command-injection-in-quote-function)
- [shell-quote command injection via Windows drive letter regex](https://junglewise.ai/threats/cve-2021-42740-shell-quote-command-injection-via-windows-drive-letter-regex)
- [shell-quote command injection in argument escaping](https://junglewise.ai/threats/cve-2016-10541-shell-quote-command-injection-in-argument-escaping)
