CVE-2026-5222
Cargo can be coerced to share credentials between registries
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.
INFO
Published Date :
May 25, 2026, 10:16 a.m.
Last Modified :
June 1, 2026, 5:56 p.m.
Remotely Exploit :
Yes !
Source :
986d4109-89ea-491f-99fd-a8e4803919bd
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS 3.1 | MEDIUM | [email protected] | ||||
| CVSS 4.0 | LOW | 986d4109-89ea-491f-99fd-a8e4803919bd | ||||
| CVSS 4.0 | LOW | 986d4109-89ea-491f-99fd-a8e4803919bd |
Solution
- Update Cargo to a version later than 1.96.
- Configure registry URLs carefully.
- Avoid hosting multiple registries on the same domain.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2026-5222.
| URL | Resource |
|---|---|
| https://blog.rust-lang.org/2026/05/25/cve-2026-5222/ | Vendor Advisory |
| https://github.com/rust-lang/cargo/pull/17031 | Issue Tracking Patch |
| https://groups.google.com/g/rustlang-security-announcements/c/SfUxOiIdY5s | Third Party Advisory Mailing List |
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2026-5222 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2026-5222
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2026-5222 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2026-5222 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
Initial Analysis by [email protected]
Jun. 01, 2026
Action Type Old Value New Value Added CVSS V3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N Added CPE Configuration OR *cpe:2.3:a:rust-lang:cargo:*:*:*:*:*:rust:*:* versions from (including) 1.68.0 up to (excluding) 1.96.0 Added Reference Type rust: https://blog.rust-lang.org/2026/05/25/cve-2026-5222/ Types: Vendor Advisory Added Reference Type rust: https://github.com/rust-lang/cargo/pull/17031 Types: Issue Tracking, Patch Added Reference Type rust: https://groups.google.com/g/rustlang-security-announcements/c/SfUxOiIdY5s Types: Mailing List, Third Party Advisory -
New CVE Received by 986d4109-89ea-491f-99fd-a8e4803919bd
May. 25, 2026
Action Type Old Value New Value Added 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. Added CVSS V4.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 Added CWE CWE-647 Added Reference https://blog.rust-lang.org/2026/05/25/cve-2026-5222/ Added Reference https://github.com/rust-lang/cargo/pull/17031 Added Reference https://groups.google.com/g/rustlang-security-announcements/c/SfUxOiIdY5s