Vulnerability · Published Jan 11, 2023 · Assigned by GitHub_M

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

Medium 5.3

In plain English

A medium-severity security flaw in cargo from rust-lang. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.7% (higher than 53% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)5.3Medium
Exploit odds (30 days)0.7%top 47.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.24chromium-rust1.66.1-r0ALPINE-CVE-2022-46176
Alpine:v3.20rust1.66.1-r0ALPINE-CVE-2022-46176
Alpine:v3.21rust1.66.1-r0ALPINE-CVE-2022-46176
Alpine:v3.22rust1.66.1-r0ALPINE-CVE-2022-46176
Alpine:v3.23rust1.66.1-r0ALPINE-CVE-2022-46176
Alpine:v3.24rust1.66.1-r0ALPINE-CVE-2022-46176
Debian:12cargo0.66.0+ds1-1DEBIAN-CVE-2022-46176
Debian:12rust-cargo0.66.0-1DEBIAN-CVE-2022-46176
Debian:13rust-cargo0.66.0-1DEBIAN-CVE-2022-46176
Debian:14rust-cargo0.66.0-1DEBIAN-CVE-2022-46176
Ubuntu:22.04:LTScargo0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2UBUNTU-CVE-2022-46176

Affected products (as reported)

VendorProductVersions
rust-lang cargo <= 0.67.0

Weakness: CWE-347 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N

References