CVEfocus › CVE database › CVE-2019-16760

CVE-2019-16760Cargo prior to Rust 1.26.0 may download the wrong dependency

CVSS 4.6 MediumEPSS 1.3% (higher than 70% of CVEs)Published 2019-09-30Updated 2024-08-05Assigner: GitHub_M

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.

CWE-16

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

17Fixed
2Fix pending
19Not affected

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 16.04cargoNot affected
vulnerable_code_not_present
Ubuntu 16.04rustcNot affected
vulnerable_code_not_present
Ubuntu 14.04cargoFix pending
Ubuntu 14.04rustcFix pending
Debian 12cargoFixed0.27.0-1DEBIAN-CVE-2019-16760
Red Hat Enterprise Linux 8cargoNot affected
Red Hat Enterprise Linux 8cargo-docNot affected
Red Hat Enterprise Linux 8clippyNot affected
Red Hat Enterprise Linux 8rlsNot affected
Red Hat Enterprise Linux 8rustNot affected
Red Hat Enterprise Linux 8rust-analysisNot affected
Red Hat Enterprise Linux 8rust-analyzerNot affected
Red Hat Enterprise Linux 8rust-debugger-commonNot affected
Red Hat Enterprise Linux 8rust-docNot affected
Red Hat Enterprise Linux 8rust-gdbNot affected
Red Hat Enterprise Linux 8rust-lldbNot affected
Red Hat Enterprise Linux 8rust-srcNot affected
Red Hat Enterprise Linux 8rust-std-staticNot affected
Red Hat Enterprise Linux 8rust-std-static-wasm32-unknown-unknownNot affected
Red Hat Enterprise Linux 8rust-std-static-wasm32-wasiNot affected
Red Hat Enterprise Linux 8rust-toolsetNot affected
Red Hat Enterprise Linux 8rustfmtNot affected
Alpine Linux 3.24chromium-rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.24rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.23rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.22rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.21rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.20rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.19rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.18rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.17rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.16rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.15rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.14rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.13rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.12rustFixed1.26.0-r0ALPINE-CVE-2019-16760
Alpine Linux 3.11rustFixed1.26.0-r0ALPINE-CVE-2019-16760
crates.io librarycargoFixed0.27.0GHSA-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.

References

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.