{"id":"CVE-2022-46176","aliases":["ALPINE-CVE-2022-46176","AZL-12969","BELL-CVE-2022-46176","DEBIAN-CVE-2022-46176","EUVD-2023-0541","GHSA-r5w3-xm58-jv6j","OESA-2025-1236","OESA-2025-1237","SUSE-SU-2023:0132-1","SUSE-SU-2023:0133-1","UBUNTU-CVE-2022-46176","openSUSE-SU-2024:12607-1","openSUSE-SU-2024:12608-1"],"status":"published","title":"Cargo did not verify SSH host keys","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.\u003cbase\u003e.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.","severity":{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00679,"percentile":0.52629,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-347"],"published":"2023-01-10T21:09:31Z","modified":"2026-11-03T07:30:59Z","fixes":[{"ecosystem":"crates.io","package":"cargo","fixed_in":["0.67.1"],"sources":["ghsa","osv"]},{"ecosystem":"Alpine:v3.24","package":"chromium-rust","fixed_in":["1.66.1-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.18","package":"rust","fixed_in":["1.66.1-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.19","package":"rust","fixed_in":["1.66.1-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.20","package":"rust","fixed_in":["1.66.1-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.21","package":"rust","fixed_in":["1.66.1-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.22","package":"rust","fixed_in":["1.66.1-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.23","package":"rust","fixed_in":["1.66.1-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.24","package":"rust","fixed_in":["1.66.1-r0"],"sources":["osv"]},{"ecosystem":"Azure Linux:2","package":"rust","fixed_in":["1.68.2-1"],"sources":["osv"]},{"ecosystem":"Debian:12","package":"cargo","fixed_in":["0.66.0+ds1-1"],"sources":["osv"]},{"ecosystem":"Debian:12","package":"rust-cargo","fixed_in":["0.66.0-1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"rust-cargo","fixed_in":["0.66.0-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"rust-cargo","fixed_in":["0.66.0-1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","package":"rust1.66","fixed_in":["1.66.0-150400.9.9.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Leap 15.4","package":"rust1.66","fixed_in":["1.66.0-150400.9.9.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","package":"rust1.65","fixed_in":["1.65.0-150300.7.9.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS","package":"rust1.65","fixed_in":["1.65.0-150300.7.9.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS","package":"rust1.65","fixed_in":["1.65.0-150300.7.9.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Real Time 15 SP3","package":"rust1.65","fixed_in":["1.65.0-150300.7.9.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Server 15 SP3-LTSS","package":"rust1.65","fixed_in":["1.65.0-150300.7.9.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 15 SP3","package":"rust1.65","fixed_in":["1.65.0-150300.7.9.1"],"sources":["osv"]},{"ecosystem":"SUSE:Enterprise Storage 7.1","package":"rust1.65","fixed_in":["1.65.0-150300.7.9.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Leap 15.4","package":"rust1.65","fixed_in":["1.65.0-150300.7.9.1"],"sources":["osv"]},{"ecosystem":"Ubuntu:20.04:LTS","package":"cargo","fixed_in":["0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2"],"sources":["osv"]},{"ecosystem":"Ubuntu:22.04:LTS","package":"cargo","fixed_in":["0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"rust1.65","fixed_in":["1.65.0-4.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"rust1.66","fixed_in":["1.66.0-2.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.67.0"},{"fixed":"0.67.1"}]}]},{"source":"osv","ecosystem":"Alpine:v3.24","package":"chromium-rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.66.1-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.18","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.66.1-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.19","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.66.1-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.20","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.66.1-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.21","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.66.1-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.22","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.66.1-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.23","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.66.1-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.24","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.66.1-r0"}]}]},{"source":"osv","ecosystem":"Azure Linux:2","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.68.2-1"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.66.0+ds1-1"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"rust-cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.66.0-1"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"rust-cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.66.0-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"rust-cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.66.0-1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"cargo","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.67.1"}]}]},{"source":"osv","ecosystem":"openEuler:22.03-LTS-SP4","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.76.0-1.oe2203sp4"}]}],"bundled":2},{"source":"osv","ecosystem":"openEuler:22.03-LTS-SP3","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.76.0-1.oe2203sp3"}]}],"bundled":2},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","package":"rust1.66","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.66.0-150400.9.9.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.4","package":"rust1.66","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.66.0-150400.9.9.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","package":"rust1.65","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.65.0-150300.7.9.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS","package":"rust1.65","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.65.0-150300.7.9.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS","package":"rust1.65","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.65.0-150300.7.9.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Real Time 15 SP3","package":"rust1.65","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.65.0-150300.7.9.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 15 SP3-LTSS","package":"rust1.65","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.65.0-150300.7.9.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 15 SP3","package":"rust1.65","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.65.0-150300.7.9.1"}]}]},{"source":"osv","ecosystem":"SUSE:Enterprise Storage 7.1","package":"rust1.65","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.65.0-150300.7.9.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.4","package":"rust1.65","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.65.0-150300.7.9.1"}]}]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.8.0-1","0.16.0-0ubuntu1~16.04.1","0.18.0-0ubuntu0.16.04.1","0.22.0-0ubuntu0.16.04.1","0.23.0-0ubuntu0.16.04.1","0.25.0-1ubuntu1~16.04.1","0.26.0-0ubuntu2~16.04.1","0.29.0-1ubuntu1~16.04.1","0.31.0-3ubuntu1~16.04.1","0.32.0-1~exp1ubuntu1~16.04.1","0.33.0-1ubuntu1~16.04.1","0.35.0-0ubuntu1~16.04.1","0.36.0-0ubuntu1~16.04.1","0.37.0-3ubuntu1~16.04.1","0.38.0-0ubuntu1~16.04.1","0.40.0-3ubuntu1~16.04.1","0.42.0-0ubuntu1~16.04.1","0.44.1-0ubuntu1~16.04.1","0.47.0-1~exp1ubuntu1~16.04.1","0.47.0-1~exp1ubuntu1~16.04.1+esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.19.0-0ubuntu1","0.22.0-0ubuntu1","0.22.0-0ubuntu2","0.23.0-0ubuntu1","0.24.0-1ubuntu1","0.25.0-1ubuntu1","0.26.0-0ubuntu1","0.26.0-0ubuntu2","0.29.0-1ubuntu1~18.04.1","0.31.0-3ubuntu1~18.04.4","0.32.0-1~exp1ubuntu1~18.04.1","0.33.0-1ubuntu1~18.04.1","0.35.0-0ubuntu1~18.04.1","0.36.0-0ubuntu1~18.04.1","0.37.0-3ubuntu1~18.04.1","0.38.0-0ubuntu1~18.04.1","0.40.0-3ubuntu1~18.04.1","0.42.0-0ubuntu1~18.04.1","0.44.1-0ubuntu1~18.04.1","0.47.0-1~exp1ubuntu1~18.04.1","0.52.0-0ubuntu1~18.04.1","0.54.0-0ubuntu1~18.04.1","0.58.0-0ubuntu1~18.04.1","0.60.0ubuntu1-0ubuntu1~18.04.1","0.62.0ubuntu0libgit2-0ubuntu0.18.04.1","0.66.0+ds0ubuntu0.libgit2-0ubuntu0.18.04","0.66.0+ds0ubuntu0.libgit2-0ubuntu0.18.04.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.67.1+ds0ubuntu0.libgit2-0ubuntu0.20.04.2"}]}],"versions":["0.37.0-3ubuntu2","0.38.0-0ubuntu1","0.39.0-0ubuntu1","0.39.0+really0.38.0-0ubuntu1","0.39.0+really0.39.0-0ubuntu1","0.40.0-3ubuntu1","0.40.0-3ubuntu2","0.41.0-0ubuntu1","0.42.0-0ubuntu1","0.44.1-0ubuntu1~20.04.1","0.47.0-1~exp1ubuntu1~20.04.1","0.52.0-0ubuntu1~20.04.1","0.54.0-0ubuntu1~20.04.1","0.58.0-0ubuntu1~20.04.1","0.60.0ubuntu1-0ubuntu1~20.04.1","0.62.0ubuntu0libgit2-0ubuntu0.20.04.1","0.66.0+ds0ubuntu0.libgit2-0ubuntu0.20.04"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.67.1+ds0ubuntu0.libgit2-0ubuntu0.22.04.2"}]}],"versions":["0.52.0-0ubuntu1","0.53.0-0ubuntu2","0.54.0-0ubuntu1","0.54.0-0ubuntu2","0.57.0+ubuntu-0ubuntu1","0.58.0-0ubuntu1","0.60.0ubuntu1-0ubuntu1~22.04.1","0.62.0ubuntu0libgit2-0ubuntu0.22.04.1","0.66.0+ds0ubuntu0.libgit2-0ubuntu0.22.04"]},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"rust-cargo","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.43.1-4","0.57.0-1","0.57.0-1ubuntu0.1~esm1"]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"rust1.65","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.65.0-4.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"rust1.66","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.66.0-2.1"}]}]}],"products":[{"vendor":"rust-lang","product":"cargo"}],"references":[{"url":"https://github.com/rust-lang/cargo/security/advisories/GHSA-r5w3-xm58-jv6j","tags":["x_refsource_CONFIRM","x_transferred","Mitigation","Third Party Advisory","advisory","web"]},{"url":"https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2022-46176","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","web","report"]},{"url":"http://www.openwall.com/lists/oss-security/2023/11/05/6","tags":["x_transferred","web"]},{"url":"http://www.openwall.com/lists/oss-security/2023/11/06/5","tags":["x_transferred","web"]},{"url":"https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf","tags":["web"]},{"url":"https://www.rust-lang.org/policies/security","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-46176","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-r5w3-xm58-jv6j"},{"url":"https://security.alpinelinux.org/vuln/CVE-2022-46176","tags":["advisory"]},{"url":"https://docs.bell-sw.com/security/cves/CVE-2022-46176","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/46xxx/CVE-2022-46176.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2022-46176","tags":["advisory"]},{"url":"https://github.com/rust-lang/cargo","tags":["package"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2025-1236","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-38497","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2025-1237","tags":["advisory"]},{"url":"https://www.suse.com/support/update/announcement/2023/suse-su-20230132-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1206930","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2022-46176","tags":["web"]},{"url":"https://www.suse.com/support/update/announcement/2023/suse-su-20230133-1/","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2022-46176","tags":["report"]},{"url":"https://www.openwall.com/lists/oss-security/2023/01/10/3","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2022-46176","tags":["report"]},{"url":"","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2022-46176","title":"Cargo did not verify SSH host keys","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.\u003cbase\u003e.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.","status":"published","published":"2023-01-11T20:07:12.847Z","modified":"2025-03-10T21:30:29.733Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T14:34:32.156873Z"}],"euvd":[{"id":"EUVD-2023-0541","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.\u003cbase\u003e.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.","status":"published","published":"2023-01-11T20:07:12Z","modified":"2025-03-10T21:30:29Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T20:53:08.584552Z"}],"ghsa":[{"id":"GHSA-r5w3-xm58-jv6j","title":"Cargo did not verify SSH host keys","description":"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.\n\nThis vulnerability has been assigned CVE-2022-46176.\n\n## Overview\n\nWhen an SSH client establishes communication with a server, to prevent MITM attacks the client should check whether it already communicated with that server in the past and what the server's public key was back then. If the key changed since the last connection, the connection must be aborted as a MITM attack is likely taking place.\n\nIt was discovered that Cargo never implemented such checks, and performed no validation on the server's public key, leaving Cargo users vulnerable to MITM attacks.\n\n## Affected Versions\n\nAll Rust versions containing Cargo before 1.66.1 are vulnerable (prior to 0.67.1 for the crates.io package).\n\nNote 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.\u003cbase\u003e.insteadOf`][1] setting), as that'd cause you to clone the crates.io index through SSH.\n\n## Mitigations\n\nWe will be releasing Rust 1.66.1 today, 2023-01-10, changing Cargo to check 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.\n\nPatch files for Rust 1.66.0 are also available [here][2] for custom-built toolchains.\n\nFor the time being Cargo will not ask the user whether to trust a server's public key during the first connection. Instead, Cargo will show an error message detailing how to add that public key to the list of trusted keys. Note that this might break your automated builds if the hosts you clone dependencies or indexes from are not already trusted.\n\nIf you can't upgrade to Rust 1.66.1 yet, we recommend configuring Cargo to use the `git` CLI instead of its built-in git support. That way, all git network operations will be performed by the `git` CLI, which is not affected by this vulnerability. You can do so by adding this snippet to your [Cargo configuration file](https://doc.rust-lang.org/cargo/reference/config.html):\n\n```toml\n[net]\ngit-fetch-with-cli = true\n```\n\n## Acknowledgments\n\nThanks to the Julia Security Team for disclosing this to us according to our [security policy][3]!\n\nWe also want to thank the members of the Rust project who contributed to fixing this issue. Thanks to Eric Huss and Weihang Lo for writing and reviewing the patch, Pietro Albini for coordinating the disclosure and writing this advisory, and Josh Stone, Josh Triplett and Jacob Finkelman for advising during the disclosure.\n\n[1]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf\n[2]: https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2022-46176\n[3]: https://www.rust-lang.org/policies/security","status":"published","published":"2023-01-10T21:09:31Z","modified":"2023-11-06T16:33:35Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T14:37:15.055009Z"}],"nvd":[{"id":"CVE-2022-46176","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.\u003cbase\u003e.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.","status":"published","published":"2023-01-11T21:15:10.087Z","modified":"2026-06-17T05:11:22.09Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T14:07:35.157734Z"}],"osv":[{"id":"ALPINE-CVE-2022-46176","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.\u003cbase\u003e.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.","status":"published","published":"2023-01-11T21:15:10.087Z","modified":"2026-11-03T07:30:59.096100725Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-03T07:50:01.054176Z"},{"id":"AZL-12969","title":"CVE-2022-46176 affecting package rust for versions less than 1.68.2-1","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.\u003cbase\u003e.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. ","status":"published","published":"2023-01-11T21:15:10Z","modified":"2026-04-21T04:22:29.546365Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T15:28:02.666535Z"},{"id":"BELL-CVE-2022-46176","title":"CVE-2022-46176 does not affect BellSoft software","status":"withdrawn","published":"2023-08-31T12:14:11.31715Z","modified":"2026-01-26T09:49:03.219357Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T15:28:17.151188Z"},{"id":"CVE-2022-46176","title":"Cargo did not verify SSH host keys","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.\u003cbase\u003e.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.","status":"published","published":"2023-01-11T20:07:12.847Z","modified":"2026-10-28T02:30:51.353039812Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T15:44:27.481647Z"},{"id":"GHSA-r5w3-xm58-jv6j","title":"Cargo did not verify SSH host keys","description":"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.\n\nThis vulnerability has been assigned CVE-2022-46176.\n\n## Overview\n\nWhen an SSH client establishes communication with a server, to prevent MITM attacks the client should check whether it already communicated with that server in the past and what the server's public key was back then. If the key changed since the last connection, the connection must be aborted as a MITM attack is likely taking place.\n\nIt was discovered that Cargo never implemented such checks, and performed no validation on the server's public key, leaving Cargo users vulnerable to MITM attacks.\n\n## Affected Versions\n\nAll Rust versions containing Cargo before 1.66.1 are vulnerable (prior to 0.67.1 for the crates.io package).\n\nNote 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.\u003cbase\u003e.insteadOf`][1] setting), as that'd cause you to clone the crates.io index through SSH.\n\n## Mitigations\n\nWe will be releasing Rust 1.66.1 today, 2023-01-10, changing Cargo to check 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.\n\nPatch files for Rust 1.66.0 are also available [here][2] for custom-built toolchains.\n\nFor the time being Cargo will not ask the user whether to trust a server's public key during the first connection. Instead, Cargo will show an error message detailing how to add that public key to the list of trusted keys. Note that this might break your automated builds if the hosts you clone dependencies or indexes from are not already trusted.\n\nIf you can't upgrade to Rust 1.66.1 yet, we recommend configuring Cargo to use the `git` CLI instead of its built-in git support. That way, all git network operations will be performed by the `git` CLI, which is not affected by this vulnerability. You can do so by adding this snippet to your [Cargo configuration file](https://doc.rust-lang.org/cargo/reference/config.html):\n\n```toml\n[net]\ngit-fetch-with-cli = true\n```\n\n## Acknowledgments\n\nThanks to the Julia Security Team for disclosing this to us according to our [security policy][3]!\n\nWe also want to thank the members of the Rust project who contributed to fixing this issue. Thanks to Eric Huss and Weihang Lo for writing and reviewing the patch, Pietro Albini for coordinating the disclosure and writing this advisory, and Josh Stone, Josh Triplett and Jacob Finkelman for advising during the disclosure.\n\n[1]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf\n[2]: https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2022-46176\n[3]: https://www.rust-lang.org/policies/security","status":"published","published":"2023-01-10T21:09:31Z","modified":"2023-11-08T04:10:56.011504Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T15:46:55.480549Z"},{"id":"OESA-2025-1236","title":"rust security update","description":"Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. This package includes the Rust compiler and documentation generator.\r\n\r\nSecurity Fix(es):\n\nCargo 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\u0026apos;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\u0026apos;s [`url.\u0026lt;base\u0026gt;.insteadOf`][1] setting), as that\u0026apos;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\u0026apos;s public key is not already trusted. We recommend everyone to upgrade as soon as possible. (CVE-2022-46176)\n\nCargo downloads the Rust project’s dependencies and compiles the project. Cargo prior to version 0.72.2, bundled with Rust prior to version 1.71.1, did not respect the umask when extracting crate archives on UNIX-like systems. If the user downloaded a crate containing files writeable by any local user, another local user could exploit this to change the source code compiled and executed by the current user. To prevent existing cached extractions from being exploitable, the Cargo binary version 0.72.2 included in Rust 1.71.1 or later will purge caches generated by older Cargo versions automatically. As a workaround, configure one\u0026apos;s system to prevent other local users from accessing the Cargo directory, usually located in `~/.cargo`.(CVE-2023-38497)","status":"published","published":"2025-03-07T11:08:20Z","modified":"2026-08-18T01:18:48.215044607Z","cvss":[{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:42.714349Z"},{"id":"OESA-2025-1237","title":"rust security update","description":"Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. This package includes the Rust compiler and documentation generator.\r\n\r\nSecurity Fix(es):\n\nCargo 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\u0026apos;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\u0026apos;s [`url.\u0026lt;base\u0026gt;.insteadOf`][1] setting), as that\u0026apos;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\u0026apos;s public key is not already trusted. We recommend everyone to upgrade as soon as possible. (CVE-2022-46176)\n\nCargo downloads the Rust project’s dependencies and compiles the project. Cargo prior to version 0.72.2, bundled with Rust prior to version 1.71.1, did not respect the umask when extracting crate archives on UNIX-like systems. If the user downloaded a crate containing files writeable by any local user, another local user could exploit this to change the source code compiled and executed by the current user. To prevent existing cached extractions from being exploitable, the Cargo binary version 0.72.2 included in Rust 1.71.1 or later will purge caches generated by older Cargo versions automatically. As a workaround, configure one\u0026apos;s system to prevent other local users from accessing the Cargo directory, usually located in `~/.cargo`.(CVE-2023-38497)","status":"published","published":"2025-03-07T11:08:20Z","modified":"2026-08-18T01:17:49.109912826Z","cvss":[{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:42.714349Z"},{"id":"UBUNTU-CVE-2022-46176","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.\u003cbase\u003e.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.","status":"published","published":"2023-01-11T21:15:00Z","modified":"2025-10-24T04:54:01Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium"},{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T16:53:56.473586Z"},{"id":"DEBIAN-CVE-2022-46176","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.\u003cbase\u003e.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.","status":"published","published":"2023-01-11T21:15:10.087Z","modified":"2026-11-03T06:03:01.804043216Z","updated_at":"2026-11-03T06:43:01.507088Z"},{"id":"openSUSE-SU-2024:12607-1","title":"cargo1.65-1.65.0-4.1 on GA media","description":"These are all security issues fixed in the cargo1.65-1.65.0-4.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2024-06-15T00:00:00Z","modified":"2026-02-04T03:51:15.729022Z","updated_at":"2026-11-02T16:58:35.751245Z"},{"id":"openSUSE-SU-2024:12608-1","title":"cargo1.66-1.66.0-2.1 on GA media","description":"These are all security issues fixed in the cargo1.66-1.66.0-2.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2024-06-15T00:00:00Z","modified":"2026-02-04T03:55:34.297221Z","updated_at":"2026-11-02T16:58:35.751245Z"},{"id":"SUSE-SU-2023:0132-1","title":"Security update for rust1.66","description":"This update for rust1.66 fixes the following issues:\n\n- CVE-2022-46176: Fixed missing SSH host key verification in cargo when cloning indexes and dependencies via SSH(bsc#1206930).\n","status":"published","published":"2023-01-24T14:37:52Z","modified":"2026-02-04T04:03:54.563571Z","updated_at":"2026-11-02T15:53:51.853735Z"},{"id":"SUSE-SU-2023:0133-1","title":"Security update for rust1.65","description":"This update for rust1.65 fixes the following issues:\n\n- CVE-2022-46176: Fixed missing SSH host key verification in cargo when cloning indexes and dependencies via SSH (bsc#1206930).\n","status":"published","published":"2023-01-24T14:38:45Z","modified":"2026-02-04T03:11:02.91972Z","updated_at":"2026-11-02T15:53:51.853735Z"}]}}
