CVEfocus › CVE database › CVE-2022-46176

CVE-2022-46176Cargo did not verify SSH host keys

CVSS 5.3 MediumEPSS 0.7% (higher than 47% of CVEs)Published 2023-01-11Updated 2025-03-10Assigner: GitHub_M

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.

CWE-347

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

15Fixed
4Fix pending
36Not 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 26.04rust-cargoNot affected
vulnerable_code_not_present
Ubuntu 25.10rust-cargoNot affected
vulnerable_code_not_present
Ubuntu 24.04rust-cargoNot affected
vulnerable_code_not_present
Ubuntu 22.04cargoFixed0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2UBUNTU-CVE-2022-46176
Ubuntu 22.04rust-cargoFix pendingUBUNTU-CVE-2022-46176
Ubuntu 20.04cargoFixed0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2UBUNTU-CVE-2022-46176
Ubuntu 18.04cargoFix pendingUBUNTU-CVE-2022-46176
Ubuntu 16.04cargoFix pendingUBUNTU-CVE-2022-46176
Ubuntu 14.04cargoFix pending
Debian 14rust-cargoFixed0.66.0-1DEBIAN-CVE-2022-46176
Debian 13rust-cargoFixed0.66.0-1DEBIAN-CVE-2022-46176
Debian 12cargoFixed0.66.0+ds1-1DEBIAN-CVE-2022-46176
Debian 12rust-cargoFixed0.66.0-1DEBIAN-CVE-2022-46176
Red Hat Enterprise Linux 9cargoNot affected
Red Hat Enterprise Linux 9clippyNot affected
Red Hat Enterprise Linux 9rustNot affected
Red Hat Enterprise Linux 9rust-analysisNot affected
Red Hat Enterprise Linux 9rust-analyzerNot affected
Red Hat Enterprise Linux 9rust-debugger-commonNot affected
Red Hat Enterprise Linux 9rust-docNot affected
Red Hat Enterprise Linux 9rust-gdbNot affected
Red Hat Enterprise Linux 9rust-lldbNot affected
Red Hat Enterprise Linux 9rust-srcNot affected
Red Hat Enterprise Linux 9rust-std-staticNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-unknown-unknownNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-wasiNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-wasip1Not affected
Red Hat Enterprise Linux 9rust-toolsetNot affected
Red Hat Enterprise Linux 9rustfmtNot affected
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.66.1-r0ALPINE-CVE-2022-46176
Alpine Linux 3.24rustFixed1.66.1-r0ALPINE-CVE-2022-46176
Alpine Linux 3.23rustFixed1.66.1-r0ALPINE-CVE-2022-46176
Alpine Linux 3.22rustFixed1.66.1-r0ALPINE-CVE-2022-46176
Alpine Linux 3.21rustFixed1.66.1-r0ALPINE-CVE-2022-46176
Alpine Linux 3.20rustFixed1.66.1-r0ALPINE-CVE-2022-46176
Alpine Linux 3.19rustFixed1.66.1-r0ALPINE-CVE-2022-46176
Alpine Linux 3.18rustFixed1.66.1-r0ALPINE-CVE-2022-46176
crates.io librarycargoFixed0.67.1GHSA-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.

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.