Injection de commande OS dans shell-quote (CVE-2026-102422)
Résumé
Injection de commande OS dans shell-quote (CVE-2026-102422). L'exploitation peut entraîner la prise de contrôle totale du système. Exploitable via bash. Atténuation : mise à jour vers 1.11.0 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
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
Résumé généré automatiquement
Assemblé par SecPulse à partir des données sources (CVSS, CWE, versions affectées) à l'aide de modèles, sans IA. Vérifiez la description d'origine et les références ci-dessous.
Une vulnérabilité référencée CVE-2026-102422 a été découverte dans shell-quote.
Des attaquants peuvent cibler un point d'entrée spécifique comme bash à distance pour détourner le produit.
L'exploitation peut entraîner la prise de contrôle totale du système. Score CVSS : 8.1/10.
Action : mettez à jour shell-quote vers 1.11.0 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « shell-quote CVE-2026-102422 » sur le site de l'éditeur.
CVE-2026-102422 (shell-quote) — CWE-78 / CVSS v3 8.1
Vecteur d'attaque : distant (réseau) / non authentifié / sans interaction utilisateur
Surface d'attaque : bash / dash / ksh / zsh
Correctif : 1.11.0 — appliquer immédiatement
Contournement : Drop every token after a { comment } token before calling quote(), or reject line terminators in untrusted strings.
Plan : 1) Audit SBOM, 2) Mise à jour staging→prod, 3) Surveillance WAF/proxy sur les endpoints affectés, 4) Recherche d'IOC dans les logs.
Réfs : voir GHSA / avis éditeur / version corrigée liés sur cette page.
Une injection de commande OS (CWE-78) affecte shell-quote. Les attaquants atteignent le code vulnérable via bash sans authentification.
Consultez l'avis de l'éditeur pour les versions affectées de shell-quote. Surface d'attaque : bash / dash / ksh / zsh.
Gravité : Élevée (CVSS 8.1/10). L'exploitation peut entraîner la prise de contrôle totale du système.
Mettre à jour vers 1.11.0.
Contournement : Drop every token after a { comment } token before calling quote(), or reject line terminators in untrusted strings.
Recherchez dans les logs des requêtes correspondant aux IOC connus de cette CVE. Auditez les SBOM/dépendances.
Actions de réponse
Étapes concrètes et exemples de commandes que les équipes SOC/SRE doivent exécuter dans l'ordre
-
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 でアラート再発が無いか継続監視。
Paquets affectés
Références
- web github.com
- web github.com
- web github.com
- web npmjs.com
- web nvd.nist.gov
- web github.com