CVE-2022-46176 json
Cargo did not verify SSH host keys
published 2023-01-10 3 y ago modified 2026-06-17 4 mo ago also GHSA-r5w3-xm58-jv6j , EUVD-2023-0541
- cvss
- 5.3
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.7%
- EPSS 0.7% chance of exploitation in 30 days, percentile 52%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- crates.io cargo 0.67.1
- cargo Debian 12 0.66.0+ds1-1
- rust-cargo Debian 14, Debian 13, Debian 12 0.66.0-1
debian advisories DEBIAN-CVE-2022-46176
- cargo Ubuntu 20.04 LTS 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2
- cargo Ubuntu 22.04 LTS 0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2
ubuntu advisories UBUNTU-CVE-2022-46176
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- rust1.65 SLES for SAP 15 SP3, SLES 15 SP3-LTSS, SLE Real Time 15 SP3 +5 more 1.65.0-150300.7.9.1
- rust1.66 SLE Module for Development Tools 15 SP4, openSUSE Leap 15.4 1.66.0-150400.9.9.1
suse advisories SUSE-SU-2023:0133-1SUSE-SU-2023:0132-1
- rust1.65 openSUSE Tumbleweed 1.65.0-4.1
- rust1.66 openSUSE Tumbleweed 1.66.0-2.1
opensuse advisories openSUSE-SU-2024:12607-1openSUSE-SU-2024:12608-1
- rust Alpine 3.24, Alpine 3.23, Alpine 3.22 +4 more 1.66.1-r0
- chromium-rust Alpine 3.24 1.66.1-r0
alpine advisories ALPINE-CVE-2022-46176
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-46176 updated cvss 5.3
rust-cargo: cargo lacking ssh host key checking
-
Red Hat Enterprise Linux 8 rls, rust, cargo, clippy, rustfmt, rust-gdb, +8 more Red Hat Enterprise Linux 9 rust, cargo, clippy, rustfmt, rust-gdb, rust-src, +8 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 19 mo ago
Exploit prediction
0.68% chance of exploitation in the next 30 days, higher than 52% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N |
| NVD | 3.1 | 5.9 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| crates.io | cargo | <0.67.1 |
0.67.1 |
Affected products
- rust-lang cargo
Classification
- Weakness
-
- CWE-347 Improper Verification of Cryptographic Signature
References
-
github.com
/rust-lang/wg-security-response/tree/main/patches/CVE-2022-46176
web, patch, third-party-advisory
-
github.com
/rust-lang/cargo/security/advisories/GHSA-r5w3-xm58-jv6j
web, mitigation, third-party-advisory
-
openwall.com
/lists/oss-security/2023/11/05/6
web
- openwall.com /lists/oss-security/2023/11/06/5
-
nvd.nist.gov
/vuln/detail/CVE-2022-46176
advisory
-
git-scm.com
/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf
web
-
github.com
/rust-lang/cargo
package
-
rust-lang.org
/policies/security
web
Sources
- CVE List CVE-2022-46176
- GitHub Advisory GHSA-r5w3-xm58-jv6j
- NVD CVE-2022-46176
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.