# CVE-2023-22742: libgit2 fails to verify SSH keys by default

- Priority: **Routine**
- Reason: Not severe (CVSS 5.3, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2023-01-20 · Modified: 2025-03-10
- Aliases: SUSE-SU-2023:1788-1, SUSE-SU-2023:1909-1, UBUNTU-CVE-2023-22742, DEBIAN-CVE-2023-22742, SUSE-SU-2023:1570-1, openSUSE-SU-2024:12632-1, CGA-fq95-hrrf-5gp5, CGA-m9m4-4rrq-qg2p, GHSA-m4ch-rfv5-x5g3, GHSA-8643-3wh5-rmjq, RUSTSEC-2023-0003, ALPINE-CVE-2023-22742
- Record: https://cvemate.com/vulnerability/CVE-2023-22742 · JSON: https://cvemate.com/vulnerability/CVE-2023-22742/json

## Description

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

## Signals

- CVSS: 5.9 medium (v3.1, NVD) CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
- EPSS: 0.63%, percentile 51.646%, as of 2026-12-05
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine libgit2 (Alpine Linux): \< 1.5.1-r0
- chainguard libgit2-1.5 (Chainguard): \< 1.7.2-r0
- Crates.Io git2 (Crates.Io): \< 0.16.1
- Crates.Io libgit2-sys (Crates.Io): ≥ 0.14.0, \< 0.14.2 \| \< 0.13.5
- debian libgit2 (Debian): \< 1.5.1+ds-1
- ubuntu libgit2 (Ubuntu): \< 0.24.1-2ubuntu0.2+esm2 \| \< 0.26.0+dfsg.1-1.1ubuntu0.2+esm1 \| \< 0.28.4+dfsg.1-2ubuntu0.1 \| \< 1.1.0+dfsg.1-4.1ubuntu0.1
- libgit2 libgit2: = 1.5.0 \| \< 1.4.5 \| 1.5.0
- opensuse libgit2&distro=openSUSE Leap 15.4 (openSUSE): \< 0.26.8-150000.3.18.1 \| \< 1.3.0-150400.3.6.1 \| \< 0.28.4-150200.3.6.1
- opensuse libgit2&distro=openSUSE Tumbleweed (openSUSE): \< 1.5.1-1.1
- suse libgit2&distro=SUSE Linux Enterprise Module for Development Tools 15 SP4 (SUSE Linux Enterprise): \< 1.3.0-150400.3.6.1
- suse libgit2&distro=SUSE Linux Enterprise Real Time 15 SP3 (SUSE Linux Enterprise): \< 0.28.4-150200.3.6.1
- suse libgit2&distro=SUSE Manager Server Module 4.2 (SUSE Linux Enterprise): \< 0.28.4-150200.3.6.1
- suse libgit2&distro=SUSE Manager Server Module 4.3 (SUSE Linux Enterprise): \< 0.28.4-150200.3.6.1

## References (first 20 of 24)

- <https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq>
- <https://github.com/libgit2/libgit2/commit/42e5db98b963ae503229c63e44e06e439df50e56>
- <https://github.com/libgit2/libgit2/commit/cd6f679af401eda1f172402006ef8265f8bd58ea>
- <https://github.com/libgit2/libgit2/releases/tag/v1.4.5>
- <https://github.com/libgit2/libgit2/releases/tag/v1.5.1>
- <https://www.libssh2.org>
- <http://www.openwall.com/lists/oss-security/2023/11/06/5>
- <https://www.suse.com/support/update/announcement/2023/suse-su-20231788-1/>
- <https://bugzilla.suse.com/1207364>
- <https://www.suse.com/security/cve/CVE-2023-22742>
- <https://www.suse.com/support/update/announcement/2023/suse-su-20231909-1/>
- <https://ubuntu.com/security/CVE-2023-22742>
- <https://ubuntu.com/security/notices/USN-6678-1>
- <https://www.cve.org/CVERecord?id=CVE-2023-22742>
- <https://security-tracker.debian.org/tracker/CVE-2023-22742>
- <https://www.suse.com/support/update/announcement/2023/suse-su-20231570-1/>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/22xxx/CVE-2023-22742.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2023-22742>
- <https://github.com/rust-lang/git2-rs/security/advisories/GHSA-m4ch-rfv5-x5g3>
- <https://github.com/rust-lang/git2-rs/commit/87934f87d36753ed702792ec063be7246444a8e1>

---

Data as of 2026-12-05T18:39:40.288Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
