CVE-2026-5222
LOW 2.3CVSS 4.0Cargo can be coerced to share credentials between registries
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.
- Published
- 25 May 2026
- Last modified
- 23 Jul 2026
- Assigned by
- 986d4109-89ea-491f-99fd-a8e4803919bd
- NVD status
- Analyzed
- Weakness
- CWE-647
- Also known as
- GHSA-p688-r7jv-fm6f
- Sources
- NVDJSONOSV GHSA-p688-r7jv-fm6fJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | 986d4109-89ea-491f-99fd-a8e4803919bd (Secondary) | CVSS 4.0 | LOW 2.3 | 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 |
| OSV | GitHub | CVSS 4.0 | 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 | |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | rust-lang | cargocpe:2.3:a:rust-lang:cargo:*:*:*:*:*:rust:*:* |
>= 1.68.0, < 1.96.0 | 1.96.0 |
| OSV | crates.io | cargo | < 0.97.0 | 0.97.0 |
References
- https://blog.rust-lang.org/2026/05/25/cve-2026-5222/ · Vendor Advisory, WEB
- https://github.com/rust-lang/cargo/pull/17031 · Issue Tracking, Patch, WEB
- https://groups.google.com/g/rustlang-security-announcements/c/SfUxOiIdY5s · Mailing List, Third Party Advisory, WEB
- https://github.com/rust-lang/cargo/security/advisories/GHSA-p688-r7jv-fm6f · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-5222 · ADVISORY
- https://github.com/rust-lang/cargo · PACKAGE
History
- 25 Nov 2026 21:02 UTC · NVD: first stored (published 25 May 2026)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 26 Jun 2026)