CVE-2026-5222 PUBLISHED

Cargo can be coerced to share credentials between registries

Assigner: rust
Reserved: 31.03.2026 Published: 25.05.2026 Updated: 25.05.2026

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.

Metrics

CVSS 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
CVSS Score: 2.3

Product Status

Vendor Rust
Product Cargo
Versions Default: unaffected
  • affected from 1.68.0 to 1.96.0 (excl.)

Solutions

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.

References

Problem Types

  • CWE-647 Use of Non-Canonical URL paths for authorization decisions CWE