Cargo can be coerced to share credentials between registries
Summary
| CVE | CVE-2026-5222 |
|---|---|
| State | PUBLISHED |
| Assigner | rust |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-05-25 10:16:15 UTC |
| Updated | 2026-05-26 19:08:15 UTC |
| Description | Cargo between 1.68 and 1.96 incorrectly normalized the URLs of third-party registries using the sparse index protocol. 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. The severity of the vulnerability is **low**, due to the extremely niche requirements needed to achieve the attack. |
Risk And Classification
Primary CVSS: v4.0 2.3 LOW from 986d4109-89ea-491f-99fd-a8e4803919bd
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
EPSS: 0.000390000 probability, percentile 0.116950000 (date 2026-05-26)
Problem Types: CWE-647 | CWE-647 CWE-647 Use of Non-Canonical URL paths for authorization decisions
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 4.0 | 986d4109-89ea-491f-99fd-a8e4803919bd | Secondary | 2.3 | LOW | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N/E:X/C... |
| 4.0 | CNA | CVSS | 2.3 | LOW | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N |
CVSS v4.0 Breakdown
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Vendor Declared Affected Products
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| groups.google.com/g/rustlang-security-announcements/c/SfUxOiIdY5s | 986d4109-89ea-491f-99fd-a8e4803919bd | groups.google.com | |
| blog.rust-lang.org/2026/05/25/cve-2026-5222 | 986d4109-89ea-491f-99fd-a8e4803919bd | blog.rust-lang.org | |
| github.com/rust-lang/cargo/pull/17031 | 986d4109-89ea-491f-99fd-a8e4803919bd | github.com | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
Additional Advisory Data
Solutions
CNA: Rust 1.96, to be released on May 28th, 2026, will update Cargo to only strip the `.git` suffix from registry URLs using the git protocol. No mitigations are available for users of older versions of Cargo.