CVE-2022-46176
Rust vulnerability analysis and mitigation

Overview

Cargo, the Rust package manager, was found to have a security vulnerability where it did not perform SSH host key verification when cloning indexes and dependencies via SSH. This vulnerability, identified as CVE-2022-46176, affects all Rust versions containing Cargo before 1.66.1. The issue was discovered by the Julia Security Team and disclosed to the Rust Security Response WG (Rust Blog, GitHub Advisory).

Technical details

When an SSH client establishes communication with a server, it should verify the server's public key against previously known keys to prevent man-in-the-middle (MITM) attacks. Cargo failed to implement these checks, performing no validation on the server's public key. The vulnerability received a CVSS v3.1 base score of 5.9 (MEDIUM) with vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N, indicating a network-accessible vulnerability with high attack complexity (NVD).

Impact

The vulnerability could enable attackers to perform man-in-the-middle (MITM) attacks. Users were vulnerable even if they didn't explicitly use SSH for alternate registry indexes or crate dependencies, as the issue also affected cases where git was configured to replace HTTPS connections to GitHub with SSH through git's url..insteadOf setting (GitHub Advisory).

Mitigation and workarounds

The vulnerability was fixed in Rust 1.66.1, released on January 10, 2023. The update ensures Cargo checks the SSH host key and aborts the connection if the server's public key is not already trusted. For users unable to upgrade immediately, a workaround was provided by configuring Cargo to use the git CLI instead of its built-in git support by adding '[net] git-fetch-with-cli = true' to the Cargo configuration file (GitHub Advisory, Rust Blog).

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-22698HIGH8.7
  • RustRust
  • sm2
NoNoJan 10, 2026
CVE-2026-22700HIGH7.5
  • RustRust
  • sm2
NoNoJan 10, 2026
CVE-2026-22699HIGH7.5
  • RustRust
  • sm2
NoNoJan 10, 2026
CVE-2026-22705MEDIUM6.4
  • RustRust
  • ml-dsa
NoYesJan 10, 2026
CVE-2025-15504MEDIUM4.8
  • PythonPython
  • lief
NoYesJan 10, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management