Skip to main content

Rust Cargo CVE-2026-5223

| EUVDEUVD-2026-31658 MEDIUM
UNIX Symbolic Link (Symlink) Following (CWE-61)
2026-05-25 rust GHSA-jq42-7mfv-hm57
6.5
CVSS 4.0 · Vendor: rust
View

Attack ChainAIDerived

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

  1. Recon
    Attacker obtains publish access to third-party Cargo registry
  2. Delivery
    Craft malicious crate tarball containing symlink targeting another crate's cache path
  3. Exploit
    Publish malicious crate to registry
  4. Install
    Victim project adds dependency on malicious crate (directly or transitively)
  5. C2
    Victim runs cargo build or cargo check
  6. Execute
    Cargo unpacks tarball and follows symlink, overwriting target crate source files
  7. Impact
    Substituted source compiled and executed at build time with victim's privileges

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling UNIX symlink resolution
Exploitation Conditions

Exploitation requires the victim's Cargo to be configured to use a third-party registry other than crates.io - this is the single hard prerequisite, and users exclusively relying on crates.io are explicitly not affected. The attacker must have the ability to publish a crate to that third-party registry (publisher account or compromised credential on that registry). On the victim side, no authentication is required (PR:N per CVSS 4.0) and no special build configuration is needed beyond having a dependency (direct or transitive) on the malicious crate. Passive user interaction is required (UI:P): the victim must execute a Cargo command that triggers download and unpacking, such as 'cargo build', 'cargo check', 'cargo fetch', or 'cargo update'. The symlink can only target crates from the same registry (overriding cross-registry sources is not implied by the description). Exploitation is limited to platforms where symlinks have filesystem effect - Windows behavior may differ but is not addressed in available data.

Impact

The CVSS 4.0 score of 6.5 (Medium) reflects an asymmetry between vulnerable-system and subsequent-system impact: the vulnerable system (the developer's Cargo process) has only low integrity impact (VI:L), but the subsequent system scores high across all pillars (SC:H/SI:H/SA:H), capturing the supply chain cascading effect - substituted source code, once compiled, can execute arbitrary logic with the developer's full privileges. The network attack vector (AV:N) with low complexity (AC:L) and no privileges required (PR:N) indicates ease of exploitation, tempered by passive user interaction (UI:P). EPSS of 0.04% at the 14th percentile is very low, and this CVE is not in CISA KEV, suggesting no observed active exploitation to date. The realistic risk is primarily to organizations using internal or alternative third-party Cargo registries where an insider or compromised publisher account could upload a malicious crate - an elevated concern for enterprise Rust shops relying on private registries. For the general Rust ecosystem via crates.io, this vulnerability poses zero risk by policy. The medium CVSS score likely underweights the build-time code execution potential for affected users.

Exploit ScenarioDerived

An attacker with publish access to a third-party Cargo registry crafts a crate tarball containing a symlink at a predictable path - for example, bar-0.0.1/.cargo-ok pointing to the source directory of a widely depended-upon crate in the same registry's local cache. When a developer runs 'cargo build' on a project that depends on this malicious crate, Cargo downloads and unpacks the tarball, follows the symlink, and overwrites the target crate's source files with attacker-controlled content. On the next compilation, the substituted source is compiled and executed in the context of the developer's build environment, granting arbitrary code execution. No public exploit code has been identified at time of analysis, though the PR diff includes test cases that demonstrate the attack path.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.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 – Jun 08, 2026

Tarball unpacking in Rust's Cargo package manager fails to reject symlinks within downloaded crate archives, enabling a malicious crate hosted on a third-party registry to overwrite source files belonging to other crates in the victim's local registry cache. The attack requires no privileges on the attacker side (PR:N per CVSS 4.0) but passive user interaction (UI:P) - specifically, a developer running any Cargo command that triggers crate download and extraction. While crates.io users are explicitly unaffected (that registry enforces a server-side symlink prohibition), users of any third-party Cargo registry are at risk of supply chain source substitution; no public exploit has been identified at time of analysis, and EPSS is very low at 0.04%.

RemediationAI

The upstream fix is available in GitHub PR #17031 (https://github.com/rust-lang/cargo/pull/17031); however, the specific patched Cargo release version is not independently confirmed from available data - check the official advisory at https://blog.rust-lang.org/2026/05/25/cve-2026-5223/ for the exact fixed release. Once confirmed, upgrade via 'rustup update stable' to obtain the patched Cargo bundled with the new stable Rust release. As a compensating control while awaiting the patch, organizations should audit and restrict Cargo's configured registry sources to trusted, access-controlled registries only - operators of third-party registries should enforce a symlink-rejection policy analogous to crates.io's. As a more aggressive control, removing third-party registry entries from ~/.cargo/config.toml or Cargo.toml eliminates the attack surface entirely but will break any builds depending on those registries. Auditing the local Cargo registry cache (typically ~/.cargo/registry/src/) for unexpected symlinks can help detect prior exploitation.

Affected VersionsENISA

cargo 1.0.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

The root cause is CWE-61 (UNIX Symbolic Link Following). Cargo's tarball unpacker in src/cargo/sources/registry/mod.rs used the Rust 'tar' crate's Archive type without validating the EntryType of each archive member. This allowed symlinks present in a crate tarball to be written directly to the filesystem during unpacking. Because Cargo stores registry sources in a shared local cache directory (under ~/.cargo/registry/src/), a symlink in one crate's tarball could point to source files belonging to another crate from the same registry, effectively overwriting them. The fix imports EntryType from the tar crate and enforces an allowlist permitting only Regular and Directory entry types, bailing out with an error for any other type (including Symlink). Secondary changes in the PR also fix URL canonicalization for sparse registry identifiers to prevent cache path collisions. The affected product is identified by CPE cpe:2.3:a:rust_project:cargo:*:*:*:*:*:*:*:*, with no version bound on the lower end indicated by available data.

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 6.5 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:H/SI:H/SA:H
SUSE 6.3 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L
Red Hat 5.3 MEDIUM

Primary rating from Vendor (rust).

CVSS VectorVendor: rust

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

Lifecycle Timeline

2
CVSS changed
May 26, 2026 - 19:22 NVD
6.5 (MEDIUM)
CVE Published
May 25, 2026 - 08:57 nvd
UNKNOWN (no severity yet)

DescriptionCVE.org

Cargo incorrectly handled symlinks inside of crate tarballs downloaded from third-party registries, allowing a malicious crate to override the source code of another crate from the same registry. The severity of the vulnerability is medium for users of third-party registries. Users of crates.io are not affected, as crates.io forbids uploading crates containing any symlink.

Threat Intelligence Overview

EPSS Score
0.0%
Top 86% exploitable
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Social Media
4
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 MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

52
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +32
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.

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed
SUSE Linux Enterprise Module for Development Tools 15 SP7 Fixed

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