CVE-2019-16760Cargo prior to Rust 1.26.0 may download the wrong dependency
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.
What to do
Fixed builds are available from Alpine, Debian, crates.io: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 16.04 | cargo | Not affected vulnerable_code_not_present | ||
| Ubuntu 16.04 | rustc | Not affected vulnerable_code_not_present | ||
| Ubuntu 14.04 | cargo | Fix pending | ||
| Ubuntu 14.04 | rustc | Fix pending | ||
| Debian 12 | cargo | Fixed | 0.27.0-1 | DEBIAN-CVE-2019-16760 |
| Red Hat Enterprise Linux 8 | cargo | Not affected | ||
| Red Hat Enterprise Linux 8 | cargo-doc | Not affected | ||
| Red Hat Enterprise Linux 8 | clippy | Not affected | ||
| Red Hat Enterprise Linux 8 | rls | Not affected | ||
| Red Hat Enterprise Linux 8 | rust | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-analysis | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-analyzer | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-debugger-common | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-doc | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-gdb | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-lldb | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-src | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-std-static | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-std-static-wasm32-unknown-unknown | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-std-static-wasm32-wasi | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-toolset | Not affected | ||
| Red Hat Enterprise Linux 8 | rustfmt | Not affected | ||
| Alpine Linux 3.24 | chromium-rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.24 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.23 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.22 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.21 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.20 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.19 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.18 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.17 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.16 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.15 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.14 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.13 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.12 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| Alpine Linux 3.11 | rust | Fixed | 1.26.0-r0 | ALPINE-CVE-2019-16760 |
| crates.io library | cargo | Fixed | 0.27.0 | GHSA-9f3p-wvj7-q82x |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- rust cargo: affected: 1.0.0 to before 1.26.0; fixed in
1.26.0
References
- https://github.com/rust-lang/rust/security/advisories/GHSA-phjm-8x66-qw4r
- https://groups.google.com/forum/#%21topic/rustlang-security-announcements/rVQ5e3TDnpQ
- https://gist.github.com/pietroalbini/0d293b24a44babbeb6187e06eebd4992
- http://www.openwall.com/lists/oss-security/2019/10/08/3
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.