Vulnerability · Published Jan 20, 2023 · Assigned by GitHub_M

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

Medium 5.3

In plain English

A medium-severity security flaw in libgit2 from libgit2. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 49% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)5.3Medium
Exploit odds (30 days)0.6%top 50.8% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12libgit21.5.1+ds-1DEBIAN-CVE-2023-22742
Debian:13libgit21.5.1+ds-1DEBIAN-CVE-2023-22742
Debian:14libgit21.5.1+ds-1DEBIAN-CVE-2023-22742
Ubuntu:22.04:LTSlibgit21.1.0+dfsg.1-4.1ubuntu0.1USN-6678-1
Ubuntu:22.04:LTSlibgit21.1.0+dfsg.1-4.1ubuntu0.1UBUNTU-CVE-2023-22742

Affected products (as reported)

VendorProductVersions
libgit2 libgit2 < 1.4.5= 1.5.0

Weakness: CWE-347 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N

References