Skip to content
Heist/ feed
Back to feed
UnratedFix available

git2 does not verify SSH keys by default

Type: advisorySources: OSV

The git2 and libgit2-sys crates are Rust wrappers around the [libgit2]() C library. It was discovered that libgit2 1.5.0 and below did not verify SSH host keys when establishing an SSH connection, exposing users of the library to Man-In-the-Middle attacks. The libgit2 team assigned [CVE-2023-22742][libgit2-advisory] to this vulnerability. The following versions of the libgit2-sys Rust crate have been released: * libgit2-sys 0.14.2, updating the underlying libgit2 C library to version 1.5.1. * libgit2-sys 0.13.5, updating the underlying libgit2 C library to version 1.4.5. A new git2 crate version has also been released, 0.16.1. This version only bumps its libgit2-sys dependency to ensure no vulnerable libgit2-sys versions are used, but contains no code changes: if you update the libgit2-sys version there is no need to also update the git2 crate version. [You can learn more about this vulnerability in libgit2's advisory][libgit2-advisory] [libgit2]: https://libgit2.org/ [libgit2-advisory]: https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq

Products
libgit2-sys
Affected versions
Not specified
Fixed versions
0.13.5, 0.14.2
CVEs
CVE-2023-22742
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 08:42 UTC · Revision 1

Source evidence

git2 does not verify SSH keys by default

core-osv · Original source

Published 20 Jan 2023, 12:00 UTC

The git2 and libgit2-sys crates are Rust wrappers around the [libgit2]() C library. It was discovered that libgit2 1.5.0 and below did not verify SSH host keys when establishing an SSH connection, exposing users of the library to Man-In-the-Middle attacks. The libgit2 team assigned [CVE-2023-22742][libgit2-advisory] to this vulnerability. The following versions of the libgit2-sys Rust crate have been released: * libgit2-sys 0.14.2, updating the underlying libgit2 C library to version 1.5.1. * libgit2-sys 0.13.5, updating the underlying libgit2 C library to version 1.4.5. A new git2 crate version has also been released, 0.16.1. This version only bumps its libgit2-sys dependency to ensure no vulnerable libgit2-sys versions are used, but contains no code changes: if you update the libgit2-sys version there is no need to also update the git2 crate version. [You can learn more about this vulnerability in libgit2's advisory][libgit2-advisory] [libgit2]: https://libgit2.org/ [libgit2-advisory]: https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq

osv:RUSTSEC-2023-0003

libgit2-sys

Fixed versions: 0.13.5, 0.14.2

Complete source record
{
  "id": "bd27e7a4ec05d26acb90cdf0bc414f4a8899f3d211605d79c990bd009b81659e",
  "url": "https://osv.dev/vulnerability/RUSTSEC-2023-0003",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "git2 does not verify SSH keys by default",
    "summary": "The git2 and libgit2-sys crates are Rust wrappers around the [libgit2]() C library. It was discovered that libgit2 1.5.0 and below did not verify SSH host keys when establishing an SSH connection, exposing users of the library to Man-In-the-Middle attacks. The libgit2 team assigned [CVE-2023-22742][libgit2-advisory] to this vulnerability. The following versions of the libgit2-sys Rust crate have been released: * libgit2-sys 0.14.2, updating the underlying libgit2 C library to version 1.5.1. * libgit2-sys 0.13.5, updating the underlying libgit2 C library to version 1.4.5. A new git2 crate version has also been released, 0.16.1. This version only bumps its libgit2-sys dependency to ensure no vulnerable libgit2-sys versions are used, but contains no code changes: if you update the libgit2-sys version there is no need to also update the git2 crate version. [You can learn more about this vulnerability in libgit2's advisory][libgit2-advisory] [libgit2]: https://libgit2.org/ [libgit2-advisory]: https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq",
    "evidence": "osv:RUSTSEC-2023-0003",
    "products": [
      {
        "name": {
          "value": "libgit2-sys",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "0.13.5",
            "evidence": "/affected/0/ranges"
          },
          {
            "value": "0.14.2",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "RUSTSEC-2023-0003",
      "aliases": [
        "CVE-2023-22742",
        "GHSA-8643-3wh5-rmjq",
        "GHSA-m4ch-rfv5-x5g3",
        "RUSTSEC-2023-0003"
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0.0.0-0"
                },
                {
                  "fixed": "0.13.5"
                },
                {
                  "introduced": "0.14.0"
                },
                {
                  "fixed": "0.14.2"
                }
              ]
            }
          ],
          "package": {
            "name": "libgit2-sys",
            "purl": "pkg:cargo/libgit2-sys",
            "ecosystem": "crates.io"
          },
          "database_specific": {
            "cvss": null,
            "source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2023-0003.json",
            "categories": [
              "crypto-failure"
            ],
            "informational": null
          },
          "ecosystem_specific": {
            "affects": {
              "os": [],
              "arch": [],
              "functions": []
            },
            "affected_functions": null
          }
        }
      ],
      "modified": "2026-10-12T18:00:06.112206414Z",
      "provider": "osv",
      "references": [
        "https://crates.io/crates/libgit2-sys",
        "https://rustsec.org/advisories/RUSTSEC-2023-0003.html",
        "https://github.com/rust-lang/git2-rs/commit/87934f87d36753ed702792ec063be7246444a8e1"
      ],
      "provider_metadata": {
        "license": "CC0-1.0"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2023-22742",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 306359,
  "published_at": "2023-01-20T12:00:00+00:00"
}