OS Command Injection in shell-quote (CVE-2026-102422)
Summary
OS command injection in shell-quote (CVE-2026-102422). Successful exploitation can lead to full system takeover. Exploitable via bash. Mitigation: upgrade to 1.11.0 or later.
Original description
The description as published by the source.
Impact
quote() 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 in that later string ends the comment, and the rest of the string is parsed as shell input:
quote(['echo', 'ok', { comment: 'x' }, 'a\nid;#']);
// echo ok #x 'a
// id;#'
Passed to sh, bash, dash, ksh, or zsh, this runs id.
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.
Exploitation requires an attacker-controlled string containing a line terminator that follows a { comment } token in the same quote() call.
Patches
Fixed in v1.11.0: quote() throws a TypeError when a string after a { comment } token contains a line terminator (\n, \r, U+2028, or U+2029).
Workarounds
Drop every token after a { comment } token before calling quote(), or reject line terminators in untrusted strings. Separately, do not append other shell text after quote() output that contains a comment, since the comment swallows it.
Source: NIST National Vulnerability Database NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-102422 has been found in shell-quote.
Attackers can target a specific entry point like bash over the network to misuse the product.
Successful exploitation can lead to full system takeover. CVSS score: 8.1/10.
What to do: upgrade shell-quote to 1.11.0 or later.
If unsure, ask your IT team or search "shell-quote CVE-2026-102422" on the vendor's site.
CVE-2026-102422 (shell-quote) — CWE-78 / CVSS v3 8.1
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: bash / dash / ksh / zsh
Patched: 1.11.0 — apply immediately
Workaround: Drop every token after a { comment } token before calling quote(), or reject line terminators in untrusted strings.
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
OS command injection (CWE-78) exists in shell-quote. Attackers reach the vulnerable code path via bash without authentication.
Check the vendor advisory for the affected versions of shell-quote. Attack surface: bash / dash / ksh / zsh.
Severity: High (CVSS 8.1/10). Successful exploitation can lead to full system takeover.
Update to 1.11.0.
Workaround: Drop every token after a { comment } token before calling quote(), or reject line terminators in untrusted strings.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'shell-quote' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'shell-quote' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
shell-quoteを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply temporary workaround mitigate
Drop every token after a `{ comment }` token before calling `quote()`, or reject line terminators in untrusted strings.パッチが適用されるまでの応急処置として、Drop every token after a
{ comment }token before callingquote(), or reject line terminators in untrusted strings. を実施。回避策の副作用 (機能低下) を確認した上で。 -
3Apply patch patch
Upgrade shell-quote to 1.11.0ステージング環境で 1.11.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- web github.com
- web github.com
- web github.com
- web npmjs.com
- web nvd.nist.gov
- web github.com