CVE-2019-16760 — Vulnerability in cargo — CVE Details
Cargo prior to Rust 1.26.0 may download the wrong dependency
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.26%). Schedule for your next planned update.
Does your project use an affected cargo version?
Paste your Cargo.lock to check it for CVE-2019-16760 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Cargo prior to Rust 1.26.0 may download the wrong dependency if your package.toml file uses the package configuration key. Usage of the package key to rename dependencies in Cargo.toml is ignored in Rust 1.25.0 and prior. When Rust 1.25.0 and prior is used Cargo may download the wrong dependency, which could be squatted on crates.io to be a malicious package. This not only affects manifests that you write locally yourself, but also manifests published to crates.io. Rust 1.0.0 through Rust 1.25.0 is affected by this advisory because Cargo will ignore the package key in manifests. Rust 1.26.0 through Rust 1.30.0 are not affected and typically will emit an error because the package key is unstable. Rust 1.31.0 and after are not affected because Cargo understands the package key. Users of the affected versions are strongly encouraged to update their compiler to the latest available one. Preventing this issue from happening requires updating your compiler to be either Rust 1.26.0 or newer. There will be no point release for Rust versions prior to 1.26.0. Users of Rust 1.19.0 to Rust 1.25.0 can instead apply linked patches to mitigate the issue.
Advisory Timeline
- First published May 24, 2022 (1647 days ago).
- Last revised September 10, 2026 — 1569 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
cargo update -p cargo --precise 0.27.0
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: crates.io (1).
| Package | Fixed In |
|---|---|
| cargo crates.io · Affected: All versions | 0.27.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-494
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
References
- https://github.com/rust-lang/rust/security/advisories/GHSA-phjm-8x66-qw4rWEB
- https://nvd.nist.gov/vuln/detail/CVE-2019-16760ADVISORY
- https://gist.github.com/pietroalbini/0d293b24a44babbeb6187e06eebd4992WEB
- https://groups.google.com/forum/#!topic/rustlang-security-announcements/rVQ5e3TDnpQWEB
- https://groups.google.com/forum/#%21topic/rustlang-security-announcements/rVQ5e3TDnpQWEB
- https://www.openwall.com/lists/oss-security/2019/10/08/3WEB
Frequently Asked Questions
- What is CVE-2019-16760?
- Cargo prior to Rust 1.26.0 may download the wrong dependency. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2019-16760?
- CVE-2019-16760 affects cargo. It has a 1.3% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2019-16760 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is an above-median EPSS score — 69.6% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-83816HIGH
CodeWhale: exec_shell parallel-readonly classifier auto-approves fd/rg/git grep exec flags enabling silent RCE
- CVE-2026-83817HIGH
CodeWhale: Automation auto_approve defaults to true, bypassing the task-path hardening fix for silent recurring agent execution
- CVE-2023-38497HIGH
Cargo not respecting umask when extracting crate archives
- CVE-2026-5223MEDIUM
Cargo crates in third party registries can override the cached source of other crates