CVE-2026-5222

Cargo can be coerced to share credentials between registries

Published May 25, 2026 CVSS 4.0 · 2.3 Low EPSS < 1% KEV · Not listed
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.

Remediation

Vendor Solution

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.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-p688-r7jv-fm6f Cargo can be coerced to share credentials between registries
History
Type Values Removed Values Added
CPEs cpe:2.3:a:rust-lang:cargo:*:*:*:*:*:rust:*:*
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N'}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Rust-lang
Rust-lang cargo
Vendors & Products Rust-lang
Rust-lang cargo
Type Values Removed Values 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.
Title Cargo can be coerced to share credentials between registries
Weaknesses CWE-647
References
Metrics cvssV4_0

{'score': 2.3, 'vector': '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'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
rust
Published
Updated
May 26, 2026, 2:43 PM
Reserved
Mar 31, 2026, 12:07 PM
Status
Analyzed
Published
May 25, 2026, 10:16 AM
Modified
Jul 23, 2026, 5:10 PM