OS Command Injection in shell-quote
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
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
-
1
Identify exposureidentify
grep -r 'shell-quote' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
shell-quoteを grep し、稼働しているサービス・バージョンを把握する。 -
2
Apply temporary workaroundmitigate
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. を実施。回避策の副作用 (機能低下) を確認した上で。 -
3
Apply patchpatch
Upgrade shell-quote to 1.11.0ステージング環境で 1.11.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4
Post-deployment verificationverify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| npmshell-quote |
≥ 1.8.4, < 1.11.0→ 1.11.0 |
1.11.0 |
Fix status by distribution
Records published by each distribution for this CVE. Fixed versions differ by release; check each link.
- Debian DEBIAN-CVE-2026-102422 node-shell-quote Fix available
- Ubuntu UBUNTU-CVE-2026-102422 node-shell-quote Fix available
Original description The description as published by the source.
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.
Source: NIST National Vulnerability Database NVD GitHub Advisory
References
- advisory github.com
- advisory nvd.nist.gov
- advisory github.com
- package github.com
- patch github.com
- web npmjs.com
- web github.com