Skip to content
Heist/ feed
Back to feed
Medium

Cargo did not verify SSH host keys

Type: advisorySources: OSV

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..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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-46176
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 15:24 UTC · Revision 1

Source evidence

Cargo did not verify SSH host keys

core-osv · Original source

Published 11 Jan 2023, 20:07 UTC

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..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.

osv:CVE-2022-46176
Complete source record
{
  "id": "b2921149cb8af2602829b8ec8ee01af06b4c82f8e8d18a5d153d770afc93db1f",
  "url": "https://osv.dev/vulnerability/CVE-2022-46176",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Cargo did not verify SSH host keys",
    "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..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.",
    "evidence": "osv:CVE-2022-46176",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2022-46176",
      "aliases": [
        "CVE-2022-46176",
        "GHSA-r5w3-xm58-jv6j"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/rust-lang/cargo",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "last_affected": "d65d197ad5c6c09234369f219f943e291d4f04b9"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "0.67.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "cpe": "cpe:2.3:a:rust-lang:cargo:*:*:*:*:*:rust:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "0.67.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "0.67.0",
            "0.59.0",
            "0.54.0",
            "0.43.0",
            "0.42.0",
            "0.37.0",
            "0.36.0",
            "0.30.0",
            "0.14.0",
            "0.13.0",
            "0.12.0",
            "0.11.0",
            "0.10.0",
            "0.9.0",
            "0.8.0",
            "0.7.0",
            "0.6.0",
            "0.5.0",
            "0.4.0",
            "0.3.0",
            "0.2.0",
            "0.1.0",
            "v0.0.1-pre"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-46176.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:51.353039812Z",
      "provider": "osv",
      "references": [
        "https://github.com/rust-lang/wg-security-response/tree/main/patches/CVE-2022-46176",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/46xxx/CVE-2022-46176.json",
        "https://github.com/rust-lang/cargo/security/advisories/GHSA-r5w3-xm58-jv6j",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-46176"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-347"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/46xxx/CVE-2022-46176.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-46176",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 519755,
  "published_at": "2023-01-11T20:07:12.847+00:00"
}