# CVE-2026-102422: shell-quote \`quote()\` command injection via a line terminator in a token after a \`{ comment }\` token

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.2
- **CVSS:** 9.2 (v4.0, CNA) `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`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: Present; Privileges required: None; User interaction: None; Confidentiality impact: High; Integrity impact: High; Availability impact: High; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.69% (percentile 48, 2026-11-26)
- **CWE:** CWE-78
- **Aliases:** GHSA-pqg4-j6r4-53mv
- **Published:** 2026-09-29T03:47:36.376Z
- **Modified:** 2026-10-06T13:45:06.393Z

## Who should check

- Projects that depend on npm package shell-quote (\>= 1.8.4, \< 1.11.0)
- Anyone running shell-quote \>= 1.8.4, \< 1.11.0

## 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.

## Affected and fixed versions

- npm `shell-quote`: affected \>= 1.8.4, \< 1.11.0; fixed 1.11.0 (osv)
- shell-quote: \>= 1.8.4, \< 1.11.0 (cvelist)

## Mitigation

- Upgrade shell-quote to 1.11.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-102422. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-102422.md
Affected: shell-quote >= 1.8.4, < 1.11.0
Fixed in: 1.11.0

Steps:
1. Search this machine and project for shell-quote (npm), shell-quote: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-102422 being exploited?

There is no confirmed exploitation: CVE-2026-102422 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.69% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-102422?

Critical: CVSS 9.2 (v4.0, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2026-102422?

shell-quote \>= 1.8.4, \< 1.11.0.

### Is there a fix for CVE-2026-102422?

Yes. Fixed in 1.11.0. Upgrade shell-quote to 1.11.0 or later.

### How do I check if I'm affected by CVE-2026-102422?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/ljharb/shell-quote/security/advisories/GHSA-pqg4-j6r4-53mv>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2026-102422>
- patch: <https://github.com/ljharb/shell-quote/commit/6002b2ed90c6b83095eb272b6b0adaf3a172b0bc>
- other: <https://github.com/ljharb/shell-quote>
- other: <https://www.npmjs.com/package/shell-quote>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-102422>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-pqg4-j6r4-53mv> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2026-102422> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-102422>
