Skip to content
OpenAdvisories
Medium · 5.3 CVE-2022-46176 EUVD-2023-0541GHSA-r5w3-xm58-jv6j

Cargo did not verify SSH host keys

Published Jan 11, 2023 · Updated Mar 10, 2025 · Assigned by GitHub_M

Description

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.

Affected products

VendorProductAffectedFixed
rust-lang cargo <= 0.67.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 rust-cargo 0.66.0-1 —
Debian 13 rust-cargo 0.66.0-1 —
Debian 12 cargo 0.66.0+ds1-1 —
Debian 12 rust-cargo 0.66.0-1 —
ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS cargo 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2 —
Ubuntu 20.04 LTS cargo 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2 —
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 22.04 LTS rust-cargo No fix yet —
Ubuntu Pro 18.04 LTS cargo No fix yet —
Ubuntu Pro 16.04 LTS cargo No fix yet —
ReleasePackageFixed inAdvisory
SLES 15 SP4 rust1.65 1.65.0-150300.7.9.1 SUSE-SU-2023:0133-1
SLES 15 SP4 rust1.66 1.66.0-150400.9.9.1 SUSE-SU-2023:0132-1
SLES 15 SP3 rust1.65 1.65.0-150300.7.9.1 SUSE-SU-2023:0133-1
Show 4 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 15 SP3 rust1.65 1.65.0-150300.7.9.1 SUSE-SU-2023:0133-1
SLE Real Time 15 SP3 rust1.65 1.65.0-150300.7.9.1 SUSE-SU-2023:0133-1
SLE HPC 15 SP3 rust1.65 1.65.0-150300.7.9.1 SUSE-SU-2023:0133-1
SUSE Enterprise Storage 7.1 rust1.65 1.65.0-150300.7.9.1 SUSE-SU-2023:0133-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed rust1.65 1.65.0-4.1 openSUSE-SU-2024:12607-1
openSUSE Tumbleweed rust1.66 1.66.0-2.1 openSUSE-SU-2024:12608-1
openSUSE Leap 15.4 rust1.65 1.65.0-150300.7.9.1 SUSE-SU-2023:0133-1
openSUSE Leap 15.4 rust1.66 1.66.0-150400.9.9.1 SUSE-SU-2023:0132-1
ReleasePackageFixed inAdvisory
Alpine v3.24 rust +1 1.66.1-r0 —
Alpine v3.23 rust 1.66.1-r0 —
Alpine v3.22 rust 1.66.1-r0 —
Alpine v3.21 rust 1.66.1-r0 —
Alpine v3.20 rust 1.66.1-r0 —
Show 2 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 rust 1.66.1-r0 —
Alpine v3.18 rust 1.66.1-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 rust +13 1.66.1-1.amzn2023.0.3 ALAS2023-2023-109

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 2 (CBL-Mariner) rust 1.68.2-1 —

Affected packages

EcosystemPackageAffectedFixedRecord
crates.io cargo < 0.67.1 0.67.1 GHSA-r5w3-xm58-jv6j

Advisories 5

References