Cargo can be coerced to share credentials between registries

Summary

CVECVE-2026-5222
StatePUBLISHED
Assignerrust
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-05-25 10:16:15 UTC
Updated2026-05-26 19:08:15 UTC
DescriptionCargo 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


VersionSourceTypeScoreSeverityVector
4.0986d4109-89ea-491f-99fd-a8e4803919bdSecondary2.3LOWCVSS: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.0CNACVSS2.3LOWCVSS: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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Confidentiality
Low
Integrity
None
Availability
None
Sub Conf.
Low
Sub Integrity
None
Sub Availability
None

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

SourceVendorProductVersionPlatforms
CNA Rust Cargo affected 1.68.0 1.96.0 semver Not specified

References

ReferenceSourceLinkTags
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.

© CVE.report 2026 |

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report