CVE-2026-5222: Cargo Sparse Registry Credential Disclosure via URL Normalization
- Vendor
- RustLang
CVE-2026-5222 is a low-severity information-disclosure vulnerability in Cargo versions shipped with Rust 1.68 through versions before Rust 1.96. Cargo applied Git-oriented normalization that strips a .git suffix to third-party registry URLs using the sparse index protocol. On generic HTTPS hosting, sparse registry locations differing only by that suffix can be distinct resources. This normalization can cause Cargo to associate credentials for a legitimate registry with an attacker-controlled registry endpoint and disclose a victim's Cargo token.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
An attacker can obtain a victim's third-party Cargo registry credential. The exposed token may permit authenticated access to the legitimate registry, subject to that registry's token scope and authorization model. The issue does not affect integrity or availability directly, and users of crates.io are not affected.
Mitigation
If you can’t patch tonight, do this now.
No mitigation is available for affected older Cargo versions. Where an upgrade cannot be performed immediately, avoid using affected third-party sparse registries, particularly registries hosted in shared domains or environments that permit arbitrary registry-path creation and cross-registry dependencies.
Remediation
Patch, then assume compromise.
Upgrade to Rust 1.96 or later. The corrected Cargo behavior strips the .git suffix only for registry URLs using the Git protocol, preventing sparse registries with distinct HTTPS paths from sharing credentials.
Exploits
No public exploits tracked yet. Mallory keeps watching.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2026-5222 exploited in the wild?
- As of Sep 25, 2026, Mallory has no reports of CVE-2026-5222 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2026-5222?
- As of Sep 25, 2026, Mallory has found no public exploit for CVE-2026-5222.
- Is there a patch for CVE-2026-5222?
- Upgrade to Rust 1.96 or later. The corrected Cargo behavior strips the .git suffix only for registry URLs using the Git protocol, preventing sparse registries with distinct HTTPS paths from sharing credentials.
- What products are affected by CVE-2026-5222?
- RustLang Cargo.
- How severe is CVE-2026-5222?
- CVE-2026-5222 has a CVSS v4 score of 2.3 (Low) and an EPSS score of 0.48% (42nd percentile) as of Sep 25, 2026.
Recent activity
25 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.