CVE-2022-46176Cargo did not verify SSH host keys
Cargo is a Rust package manager. The Rust Security Response WG was notified that Cargo did not perform SSH host key verification when cloning indexes and dependencies via SSH. An attacker could exploit this to perform man-in-the-middle (MITM) attacks. This vulnerability has been assigned CVE-2022-46176. All Rust versions containing Cargo before 1.66.1 are vulnerable. Note that even if you don't explicitly use SSH for alternate registry indexes or crate dependencies, you might be affected by this vulnerability if you have configured git to replace HTTPS connections to GitHub with SSH (through git's [`url.<base>.insteadOf`][1] setting), as that'd cause you to clone the crates.io index through SSH. Rust 1.66.1 will ensure Cargo checks the SSH host key and abort the connection if the server's public key is not already trusted. We recommend everyone to upgrade as soon as possible.
What to do
Fixed builds are available from Alpine, Debian, Ubuntu, 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 26.04 | rust-cargo | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | rust-cargo | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | rust-cargo | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | cargo | Fixed | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2 | UBUNTU-CVE-2022-46176 |
| Ubuntu 22.04 | rust-cargo | Fix pending | UBUNTU-CVE-2022-46176 | |
| Ubuntu 20.04 | cargo | Fixed | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2 | UBUNTU-CVE-2022-46176 |
| Ubuntu 18.04 | cargo | Fix pending | UBUNTU-CVE-2022-46176 | |
| Ubuntu 16.04 | cargo | Fix pending | UBUNTU-CVE-2022-46176 | |
| Ubuntu 14.04 | cargo | Fix pending | ||
| Debian 14 | rust-cargo | Fixed | 0.66.0-1 | DEBIAN-CVE-2022-46176 |
| Debian 13 | rust-cargo | Fixed | 0.66.0-1 | DEBIAN-CVE-2022-46176 |
| Debian 12 | cargo | Fixed | 0.66.0+ds1-1 | DEBIAN-CVE-2022-46176 |
| Debian 12 | rust-cargo | Fixed | 0.66.0-1 | DEBIAN-CVE-2022-46176 |
| Red Hat Enterprise Linux 9 | cargo | Not affected | ||
| Red Hat Enterprise Linux 9 | clippy | Not affected | ||
| Red Hat Enterprise Linux 9 | rust | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-analysis | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-analyzer | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-debugger-common | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-doc | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-gdb | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-lldb | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-src | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-std-static | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-std-static-wasm32-unknown-unknown | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-std-static-wasm32-wasi | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-std-static-wasm32-wasip1 | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-toolset | Not affected | ||
| Red Hat Enterprise Linux 9 | rustfmt | Not affected | ||
| 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.66.1-r0 | ALPINE-CVE-2022-46176 |
| Alpine Linux 3.24 | rust | Fixed | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| Alpine Linux 3.23 | rust | Fixed | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| Alpine Linux 3.22 | rust | Fixed | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| Alpine Linux 3.21 | rust | Fixed | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| Alpine Linux 3.20 | rust | Fixed | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| Alpine Linux 3.19 | rust | Fixed | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| Alpine Linux 3.18 | rust | Fixed | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| crates.io library | cargo | Fixed | 0.67.1 | GHSA-r5w3-xm58-jv6j |
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-lang cargo: affected: <= 0.67.0
References
- https://github.com/rust-lang/cargo/security/advisories/GHSA-r5w3-xm58-jv6j
- https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2022-46176
- http://www.openwall.com/lists/oss-security/2023/11/05/6
- http://www.openwall.com/lists/oss-security/2023/11/06/5
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.