Skip to main content

Rust Cargo EUVDEUVD-2026-31654

| CVE-2026-5222 LOW
Use of Non-Canonical URL Paths for Authorization Decisions (CWE-647)
2026-05-25 rust GHSA-p688-r7jv-fm6f
2.3
CVSS 4.0 · Vendor: rust
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify multi-tenant sparse registry hosting provider
  2. Delivery
    Register attacker-controlled registry at path colliding with victim's .git-suffixed URL
  3. Exploit
    Wait for victim to run Cargo operation against their registry
  4. Execution
    Cargo normalizes both registry URLs to identical canonical identifier
  5. Persist
    Cargo transmits victim's registry credentials to attacker endpoint
  6. Impact
    Attacker captures and reuses registry credentials

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V6 - Authentication Use of non-canonical URL paths
Exploitation Conditions

Three specific conditions must simultaneously hold: (1) the victim must be using a third-party registry configured with the sparse index protocol (i.e., the registry URL begins with sparse+https://), not the default crates.io or a git-protocol registry; (2) the registry hosting provider must allow multiple distinct registries to be hosted under arbitrary path names within the same domain (a multi-tenant hosting model); and (3) an attacker must be able to register and control a registry on that same hosting provider whose path differs from the victim's registry only by the presence or absence of a .git suffix. Exploitation additionally requires the victim to perform a Cargo operation that causes registry credential submission (UI:P). Exploitation is limited by the rarity of this exact hosting configuration in practice. Organizations using self-hosted, single-tenant, or dedicated-domain sparse registries are not exposed.

Impact

All available signals converge on low real-world risk. The CVSS 4.0 score is 2.3, with AT:P (attack requirements: partial) directly reflecting the niche infrastructure conditions required. UI:P (user participation required) adds a further barrier. EPSS is 0.04% at the 12th percentile, indicating near-negligible automated exploitation likelihood. SSVC assesses exploitation as none and the attack as not automatable with only partial technical impact. The vulnerability is not listed in CISA KEV. The vendor's own advisory characterizes severity as low due to extremely niche requirements. The confidentiality impact is limited to registry credentials (VC:L, SC:L), with no integrity or availability impact. There is no conflict between signals - CVSS, EPSS, SSVC, and vendor assessment are all self-consistent. This is not a prioritization candidate for most organizations; risk is meaningful only to teams using sparse-protocol third-party registries hosted on multi-tenant providers that allow arbitrary registry path naming.

Exploit ScenarioDerived

An attacker who has publish access to a registry named my-registry hosted at sparse+https://shared-host.example.com/my-registry on a multi-tenant registry hosting provider could exploit this if a victim organization uses a registry at sparse+https://shared-host.example.com/my-registry.git. Cargo 1.68-1.96 strips the .git suffix during canonicalization, making both URLs resolve to the same identifier and potentially causing the victim's registry credentials to be sent to the attacker's endpoint. The victim must perform a Cargo operation (such as cargo update or cargo fetch) that triggers a registry request for the attack to succeed.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 26, 2026

Credential leakage in Cargo's sparse index registry URL normalization affects all Cargo releases from 1.68 through 1.96. The flaw caused Cargo to incorrectly apply git-registry canonicalization rules - specifically, stripping .git suffixes and lowercasing GitHub paths - to sparse index protocol URLs (prefixed with sparse+). This allowed two distinct sparse registry URLs that differed only by a .git suffix to resolve to the same canonical identifier, meaning credentials configured for one registry could be transmitted to a different, attacker-controlled registry on the same domain. No public exploit identified at time of analysis; EPSS is 0.04% (12th percentile), consistent with the vendor-assessed low severity and SSVC exploitation status of none.

RemediationAI

Upgrade Cargo to a version beyond 1.96 that incorporates the fix from upstream pull request https://github.com/rust-lang/cargo/pull/17031. The exact first patched release version is not specified in the available advisory data - consult the official Rust release notes at https://blog.rust-lang.org/2026/05/25/cve-2026-5222/ for the confirmed fixed version. As a compensating control for environments that cannot upgrade immediately, organizations can avoid using sparse-protocol registries hosted on multi-tenant providers where arbitrary registry path names within the same domain are permitted; switching to dedicated domain hosting for private registries eliminates the URL collision surface entirely. Credential rotation for any sparse-protocol third-party registry credentials should be considered if the deployment matches the vulnerable hosting topology described in the advisory.

Affected VersionsENISA

cargo 1.68.0 <1.96.0

Affected Packages

cargo cargo fix: 0.97.0, 1.96.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in cargo

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Cargo implements URL canonicalization in src/cargo/util/canonical_url.rs to produce stable, hashable identifiers for registries. For git-backed registries, stripping .git suffixes is semantically correct because git hosts typically serve the same repository at both repo and repo.git. However, for sparse index registries (identified by the sparse+https:// scheme containing a + character in the scheme), these paths are not git repos but HTTP endpoints where path components are meaningful and distinct. CWE-647 (Use of Non-Canonical URL Paths for Authorization Decisions) precisely describes this root cause: authorization/credential scoping decisions were based on a canonicalized URL that incorrectly collapsed two distinct registry identities into one. The fix in PR #17031 gates the .git-stripping and GitHub lowercasing logic on !url.scheme().contains('+'), ensuring sparse registry URLs are not subject to git-specific normalization. CPE: cpe:2.3:a:rust:cargo:*:*:*:*:*:*:*:*.

Know when Cargo gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (rust) PRIMARY 2.3 LOW
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

Primary rating from Vendor (rust) · only source for this CVE.

CVSS VectorVendor: rust

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
CVSS changed
May 26, 2026 - 19:22 NVD
2.3 (LOW)
CVE Published
May 25, 2026 - 08:54 nvd
UNKNOWN (no severity yet)

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Social Media
3
Sightings
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +12
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy