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

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.

Published: 2023-01-20 Last update: 2026-06-17 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2023-22742 is rated Low Risk (36.7/100): CVSS Medium severity, with low exploitation likelihood (EPSS 0.58%). Mandatory action: Monitor for updates and reassess as exploit intelligence or EPSS changes.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2023-22742

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-06-15 0.12% 0.58% +0.46%
2 2025-12-17 0.17% 0.12% -0.05%
3 2025-11-21 0.17%

Full EPSS history (7 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2023-22742

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
5.3 3.1 MEDIUM
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:N)
Service keeps running; no real outage angle.
1.6 3.6 [email protected]
5.9 3.1 MEDIUM
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:N)
Service keeps running; no real outage angle.
2.2 3.6 [email protected]

Weakness enumeration for CVE-2023-22742

OS Trackers for CVE-2023-22742

vendor priority summary link
alpine medium CVE-2023-22742: 1 source package rows (libgit2); 13 state rows across 3 repos (3.17-community, 3.22-community, edge-community); fixed 1, open 12. https://security.alpinelinux.org/vuln/CVE-2023-22742
debian not yet assigned CVE-2023-22742 not yet assigned priority: Debian including 1 source packages (libgit2), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 5. https://security-tracker.debian.org/tracker/CVE-2023-22742
gentoo high CVE-2023-22742: 1 GLSA(s) (202411-05), 1 atom(s) (dev-libs/libgit2); latest impact high. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2023-22742
redhat medium https://access.redhat.com/security/cve/CVE-2023-22742
suse medium CVE-2023-22742 severity moderate: SUSE including 32 source package names (5.0.0-beta1.2.122:libgit2-28-0.28.4-150200.3.6.1, git, …), 317 product×package rows across 47 product lines (Container suse/manager/5.0/x86_64/server, HPE Helion OpenStack 8, … (47 product lines)): Known Not Affected 271, Fixed 46. https://www.suse.com/security/cve/CVE-2023-22742/
ubuntu medium CVE-2023-22742 medium priority: Ubuntu including 1 source packages (libgit2), 13 status rows across 13 suites (bionic, focal, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): not-affected 6, released 5, ignored 1, needed 1. https://ubuntu.com/security/CVE-2023-22742

Affected software / configurations for CVE-2023-22742

Vendor Product Version Raw CPE
libgit2 libgit2 < 1.4.5 cpe:2.3:a:libgit2:libgit2:*:*:*:*:*:*:*:*
libgit2 libgit2 1.5.0 cpe:2.3:a:libgit2:libgit2:1.5.0:*:*:*:*:*:*:*

References for CVE-2023-22742

cvelogic Threat Intelligence