CVE-2026-5223: Cargo symlink handling flaw in third-party registry crate tarball extraction
- Vendor
- RustLang
CVE-2026-5223 is a medium-severity vulnerability in Cargo affecting crate tarballs downloaded from third-party registries. Cargo incorrectly handled symbolic links embedded in crate tarballs during extraction into the local crate source cache. Although Cargo included protections intended to prevent extraction outside a crate’s own cache directory, a malicious tarball could use symlink-based path traversal to write files one level below its assigned cache directory and thereby overwrite the cached source code of another crate from the same registry. This can cause subsequent builds to consume attacker-controlled source in place of the expected dependency. The issue affects Cargo versions shipped before Rust 1.96.0. Users of crates.io are not affected because that registry prohibits crates containing symlinks.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation allows an attacker who can publish a malicious crate to a vulnerable third-party registry to overwrite the locally cached source of other crates from that same registry on a victim system. This can result in dependency substitution at build time, causing builds to compile attacker-controlled code instead of the legitimate crate source. The primary consequence is compromise of build integrity, with potential downstream effects including arbitrary code execution during compilation or in produced artifacts, depending on how the substituted crate is used.
Mitigation
If you can’t patch tonight, do this now.
If immediate upgrade is not possible, audit third-party registry contents for crates containing symlinks and remove or block such packages. Configure third-party registries to reject uploads that contain symlinks wherever supported. Limit use of untrusted or weakly validated alternative registries until patched Cargo versions are deployed.
Remediation
Patch, then assume compromise.
Upgrade to Rust 1.96.0 or later, which updates Cargo to reject extraction of any symlink contained in crate tarballs. All Cargo versions shipped before Rust 1.96.0 should be considered affected. Registry operators should also enforce validation that rejects crates containing symlinks.
Exploits
No public exploits tracked yet. Mallory keeps watching.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2026-5223 exploited in the wild?
- As of Sep 25, 2026, Mallory has no reports of CVE-2026-5223 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2026-5223?
- As of Sep 25, 2026, Mallory has found no public exploit for CVE-2026-5223.
- Is there a patch for CVE-2026-5223?
- Upgrade to Rust 1.96.0 or later, which updates Cargo to reject extraction of any symlink contained in crate tarballs. All Cargo versions shipped before Rust 1.96.0 should be considered affected.
- What products are affected by CVE-2026-5223?
- RustLang Cargo.
- How severe is CVE-2026-5223?
- CVE-2026-5223 has a CVSS v4 score of 6.5 (Medium) and an EPSS score of 0.29% (22nd percentile) as of Sep 25, 2026.
Recent activity
16 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.