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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.24 | chromium-rust | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| Alpine:v3.20 | rust | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| Alpine:v3.21 | rust | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| Alpine:v3.22 | rust | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| Alpine:v3.23 | rust | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| Alpine:v3.24 | rust | 1.66.1-r0 | ALPINE-CVE-2022-46176 |
| Debian:12 | cargo | 0.66.0+ds1-1 | DEBIAN-CVE-2022-46176 |
| Debian:12 | rust-cargo | 0.66.0-1 | DEBIAN-CVE-2022-46176 |
| Debian:13 | rust-cargo | 0.66.0-1 | DEBIAN-CVE-2022-46176 |
| Debian:14 | rust-cargo | 0.66.0-1 | DEBIAN-CVE-2022-46176 |
| Ubuntu:22.04:LTS | cargo | 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2 | UBUNTU-CVE-2022-46176 |
Affected products (as reported)
Weakness: CWE-347 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N
References
- https://github.com/rust-lang/cargo/security/advisories/GHSA-r5w3-xm58-jv6j x_refsource_CONFIRM
- https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2022-46176 x_refsource_MISC
- http://www.openwall.com/lists/oss-security/2023/11/05/6
- http://www.openwall.com/lists/oss-security/2023/11/06/5