Vulnérabilité dans cargo (CVE-2026-5222)
Résumé
Vulnérabilité dans cargo (CVE-2026-5222). Des informations confidentielles peuvent être exposées. Exploitable via foo. Atténuation : mise à jour vers 0.97.0 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
The Rust Security Response Team was notified that Cargo incorrectly normalized the URLs of third-party registries using the [sparse index protocol][1]. If a hosting provider allowed multiple registries to be hosted with arbitrary names within the same domain, an attacker able to publish crates in a registry could obtain the credentials of others users of the same registry.
This vulnerability is tracked as CVE-2026-5222. The severity of the vulnerability is low, due to the extremely niche requirements needed to achieve the attack.
Overview
Originally Cargo only supported storing a registry's index within git repositories. Most git hosting solutions allow accessing a git repository with or without the .git suffix, so Cargo mirrored this behavior when normalizing registry URLs. This allowed credentials for https://example.com/index to be used for https://example.com/index.git.
This normalization was unintentionally applied to the new sparse indexes too. Sparse indexes can be hosted on any HTTPS server, which treat URLs ending with .git as different URLs than those without the suffix.
If the following conditions apply:
https://example.com/indexis a sparse index.https://example.com/indexallows crates to depend on crates from any other registry.- The attacker is able to publish crates on
https://example.com/index. - The attacker is able to upload arbitrary files to
https://example.com/index.git.
...the attacker could configure `https://example.…
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-5222 a été découverte dans cargo.
Des attaquants peuvent cibler un point d'entrée spécifique comme foo à distance pour détourner le produit.
Des informations confidentielles peuvent être exposées. Score CVSS : 6.5/10.
Action : mettez à jour cargo vers 0.97.0 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « cargo CVE-2026-5222 » sur le site de l'éditeur.
CVE-2026-5222 (cargo) — CWE-647 / CVSS v3 6.5
Vecteur d'attaque : distant (réseau) / sans interaction utilisateur
Surface d'attaque : foo / bar
Correctif : 0.97.0 — appliquer immédiatement
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 vulnérabilité (CWE-647) affecte cargo. Les attaquants atteignent le code vulnérable via foo.
Consultez l'avis de l'éditeur pour les versions affectées de cargo. Surface d'attaque : foo / bar.
Gravité : Moyenne (CVSS 6.5/10). Des informations confidentielles peuvent être exposées.
Mettre à jour vers 0.97.0.
En attendant le correctif : désactivez la fonctionnalité concernée, appliquez des règles WAF, ou restreignez l'accès par ACL réseau.
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 'cargo' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
cargoを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade cargo to 0.97.0ステージング環境で 0.97.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Paquets affectés
État des correctifs par distribution
Paquets corrigés publiés par chaque distribution pour cette CVE
- Alpine Linux ALPINE-CVE-2026-5222 rust Corrigé dans: 1.91.1-r2
- BellSoft Alpaquita BELL-CVE-2026-5222 rust Corrigé dans: 1.64.0-r4
- Debian DEBIAN-CVE-2026-5222 cargo
- Ubuntu UBUNTU-CVE-2026-5222 rustc
Références
- advisory nvd.nist.gov
- package github.com
- patch blog.rust-lang.org
- web github.com
- web groups.google.com
- web github.com
- web blog.rust-lang.org
- web github.com