Search

Find a vulnerability

Search criteria

    Related vulnerabilities

    CVE-2023-22742 (GCVE-0-2023-22742)

    Vulnerability from cvelistv5 – Published: 2023-01-20 22:49 – Updated: 2025-03-10 21:21
    VLAI
    Title
    libgit2 fails to verify SSH keys by default
    Summary
    libgit2 is a cross-platform, linkable library implementation of Git. When using an SSH remote with the optional libssh2 backend, libgit2 does not perform certificate checking by default. Prior versions of libgit2 require the caller to set the `certificate_check` field of libgit2's `git_remote_callbacks` structure - if a certificate check callback is not set, libgit2 does not perform any certificate checking. This means that by default - without configuring a certificate check callback, clients will not perform validation on the server SSH keys and may be subject to a man-in-the-middle attack. Users are encouraged to upgrade to v1.4.5 or v1.5.1. Users unable to upgrade should ensure that all relevant certificates are manually checked.
    SSVC
    Exploitation: none Automatable: no Technical Impact: partial
    CISA Coordinator · CISA-ADP (v2.0.3)
    Decision recorded 2025-03-10 20:59 UTC
    CWE
    • CWE-347 - Improper Verification of Cryptographic Signature
    Assigner
    GitHub_M CNA under the mitre root
    CNA scorecard C 72/100 over 7856 records in the last 180 days details
    Impacted products
    Vendor Product Version
    libgit2 libgit2 Affected: < 1.4.5
    Affected: = 1.5.0
    Create a notification for this product.
    Show details on NVD website

    {
      "containers": {
        "adp": [
          {
            "providerMetadata": {
              "dateUpdated": "2024-08-02T10:20:30.067Z",
              "orgId": "af854a3a-2127-422b-91ae-364da2661108",
              "shortName": "CVE"
            },
            "references": [
              {
                "name": "https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq",
                "tags": [
                  "x_refsource_CONFIRM",
                  "x_transferred"
                ],
                "url": "https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq"
              },
              {
                "name": "https://github.com/libgit2/libgit2/commit/42e5db98b963ae503229c63e44e06e439df50e56",
                "tags": [
                  "x_refsource_MISC",
                  "x_transferred"
                ],
                "url": "https://github.com/libgit2/libgit2/commit/42e5db98b963ae503229c63e44e06e439df50e56"
              },
              {
                "name": "https://github.com/libgit2/libgit2/commit/cd6f679af401eda1f172402006ef8265f8bd58ea",
                "tags": [
                  "x_refsource_MISC",
                  "x_transferred"
                ],
                "url": "https://github.com/libgit2/libgit2/commit/cd6f679af401eda1f172402006ef8265f8bd58ea"
              },
              {
                "name": "https://github.com/libgit2/libgit2/releases/tag/v1.4.5",
                "tags": [
                  "x_refsource_MISC",
                  "x_transferred"
                ],
                "url": "https://github.com/libgit2/libgit2/releases/tag/v1.4.5"
              },
              {
                "name": "https://github.com/libgit2/libgit2/releases/tag/v1.5.1",
                "tags": [
                  "x_refsource_MISC",
                  "x_transferred"
                ],
                "url": "https://github.com/libgit2/libgit2/releases/tag/v1.5.1"
              },
              {
                "name": "https://www.libssh2.org",
                "tags": [
                  "x_refsource_MISC",
                  "x_transferred"
                ],
                "url": "https://www.libssh2.org"
              },
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "http://www.openwall.com/lists/oss-security/2023/11/06/5"
              }
            ],
            "title": "CVE Program Container"
          },
          {
            "metrics": [
              {
                "other": {
                  "content": {
                    "id": "CVE-2023-22742",
                    "options": [
                      {
                        "Exploitation": "none"
                      },
                      {
                        "Automatable": "no"
                      },
                      {
                        "Technical Impact": "partial"
                      }
                    ],
                    "role": "CISA Coordinator",
                    "timestamp": "2025-03-10T20:59:36.699887Z",
                    "version": "2.0.3"
                  },
                  "type": "ssvc"
                }
              }
            ],
            "providerMetadata": {
              "dateUpdated": "2025-03-10T21:21:08.962Z",
              "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "shortName": "CISA-ADP"
            },
            "title": "CISA ADP Vulnrichment"
          }
        ],
        "cna": {
          "affected": [
            {
              "product": "libgit2",
              "vendor": "libgit2",
              "versions": [
                {
                  "status": "affected",
                  "version": "\u003c 1.4.5"
                },
                {
                  "status": "affected",
                  "version": "= 1.5.0"
                }
              ]
            }
          ],
          "descriptions": [
            {
              "lang": "en",
              "value": "libgit2 is a cross-platform, linkable library implementation of Git. When using an SSH remote with the optional libssh2 backend, libgit2 does not perform certificate checking by default. Prior versions of libgit2 require the caller to set the `certificate_check` field of libgit2\u0027s `git_remote_callbacks` structure - if a certificate check callback is not set, libgit2 does not perform any certificate checking. This means that by default - without configuring a certificate check callback, clients will not perform validation on the server SSH keys and may be subject to a man-in-the-middle attack. Users are encouraged to upgrade to v1.4.5 or v1.5.1. Users unable to upgrade should ensure that all relevant certificates are manually checked."
            }
          ],
          "metrics": [
            {
              "cvssV3_1": {
                "attackComplexity": "HIGH",
                "attackVector": "NETWORK",
                "availabilityImpact": "NONE",
                "baseScore": 5.3,
                "baseSeverity": "MEDIUM",
                "confidentialityImpact": "NONE",
                "integrityImpact": "HIGH",
                "privilegesRequired": "NONE",
                "scope": "UNCHANGED",
                "userInteraction": "REQUIRED",
                "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N",
                "version": "3.1"
              }
            }
          ],
          "problemTypes": [
            {
              "descriptions": [
                {
                  "cweId": "CWE-347",
                  "description": "CWE-347: Improper Verification of Cryptographic Signature",
                  "lang": "en",
                  "type": "CWE"
                }
              ]
            }
          ],
          "providerMetadata": {
            "dateUpdated": "2023-11-07T00:06:32.714Z",
            "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
            "shortName": "GitHub_M"
          },
          "references": [
            {
              "name": "https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq",
              "tags": [
                "x_refsource_CONFIRM"
              ],
              "url": "https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq"
            },
            {
              "name": "https://github.com/libgit2/libgit2/commit/42e5db98b963ae503229c63e44e06e439df50e56",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://github.com/libgit2/libgit2/commit/42e5db98b963ae503229c63e44e06e439df50e56"
            },
            {
              "name": "https://github.com/libgit2/libgit2/commit/cd6f679af401eda1f172402006ef8265f8bd58ea",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://github.com/libgit2/libgit2/commit/cd6f679af401eda1f172402006ef8265f8bd58ea"
            },
            {
              "name": "https://github.com/libgit2/libgit2/releases/tag/v1.4.5",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://github.com/libgit2/libgit2/releases/tag/v1.4.5"
            },
            {
              "name": "https://github.com/libgit2/libgit2/releases/tag/v1.5.1",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://github.com/libgit2/libgit2/releases/tag/v1.5.1"
            },
            {
              "name": "https://www.libssh2.org",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://www.libssh2.org"
            },
            {
              "url": "http://www.openwall.com/lists/oss-security/2023/11/06/5"
            }
          ],
          "source": {
            "advisory": "GHSA-8643-3wh5-rmjq",
            "discovery": "UNKNOWN"
          },
          "title": "libgit2 fails to verify SSH keys by default"
        }
      },
      "cveMetadata": {
        "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
        "assignerShortName": "GitHub_M",
        "cveId": "CVE-2023-22742",
        "datePublished": "2023-01-20T22:49:06.378Z",
        "dateReserved": "2023-01-06T14:21:05.892Z",
        "dateUpdated": "2025-03-10T21:21:08.962Z",
        "state": "PUBLISHED"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }

    RUSTSEC-2023-0003 (CVE-2023-22742)

    Vulnerability from osv_rustsec – Published: 2023-01-20 12:00 – Updated: 2026-10-12 17:47 – Source website
    VLAI
    Summary
    git2 does not verify SSH keys by default
    Details

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

    Impacted products
    Ecosystem Package Version
    crates.io libgit2-sys
    pkg:cargo/libgit2-sys
    Affected: ≥ 0.0.0-0, < 0.13.5, ≥ 0.14.0, < 0.14.2 (semver)

    {
      "affected": [
        {
          "database_specific": {
            "categories": [
              "crypto-failure"
            ],
            "cvss": null,
            "informational": null
          },
          "ecosystem_specific": {
            "affected_functions": null,
            "affects": {
              "arch": [],
              "functions": [],
              "os": []
            }
          },
          "package": {
            "ecosystem": "crates.io",
            "name": "libgit2-sys",
            "purl": "pkg:cargo/libgit2-sys"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "0.0.0-0"
                },
                {
                  "fixed": "0.13.5"
                },
                {
                  "introduced": "0.14.0"
                },
                {
                  "fixed": "0.14.2"
                }
              ],
              "type": "SEMVER"
            }
          ],
          "versions": []
        }
      ],
      "aliases": [
        "CVE-2023-22742",
        "GHSA-m4ch-rfv5-x5g3",
        "GHSA-8643-3wh5-rmjq"
      ],
      "database_specific": {
        "license": "CC0-1.0"
      },
      "details": "The git2 and libgit2-sys crates are Rust wrappers around the\n[libgit2]() C library. It was discovered that libgit2 1.5.0\nand below did not verify SSH host keys when establishing an SSH connection,\nexposing users of the library to Man-In-the-Middle attacks.\n\nThe libgit2 team assigned [CVE-2023-22742][libgit2-advisory] to this\nvulnerability. The following versions of the libgit2-sys Rust crate have been\nreleased:\n\n* libgit2-sys 0.14.2, updating the underlying libgit2 C library to version 1.5.1.\n* libgit2-sys 0.13.5, updating the underlying libgit2 C library to version 1.4.5.\n\nA new git2 crate version has also been released, 0.16.1. This version only\nbumps its libgit2-sys dependency to ensure no vulnerable libgit2-sys versions\nare used, but contains no code changes: if you update the libgit2-sys version\nthere is no need to also update the git2 crate version.\n\n[You can learn more about this vulnerability in libgit2\u0027s advisory][libgit2-advisory]\n\n[libgit2]: https://libgit2.org/\n[libgit2-advisory]: https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq",
      "id": "RUSTSEC-2023-0003",
      "modified": "2026-10-12T17:47:59Z",
      "published": "2023-01-20T12:00:00Z",
      "references": [
        {
          "type": "PACKAGE",
          "url": "https://crates.io/crates/libgit2-sys"
        },
        {
          "type": "ADVISORY",
          "url": "https://rustsec.org/advisories/RUSTSEC-2023-0003.html"
        },
        {
          "type": "WEB",
          "url": "https://github.com/rust-lang/git2-rs/commit/87934f87d36753ed702792ec063be7246444a8e1"
        }
      ],
      "related": [],
      "severity": [],
      "summary": "git2 does not verify SSH keys by default"
    }