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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | libgit2 | 1.5.1+ds-1 | DEBIAN-CVE-2023-22742 |
| Debian:13 | libgit2 | 1.5.1+ds-1 | DEBIAN-CVE-2023-22742 |
| Debian:14 | libgit2 | 1.5.1+ds-1 | DEBIAN-CVE-2023-22742 |
| Ubuntu:22.04:LTS | libgit2 | 1.1.0+dfsg.1-4.1ubuntu0.1 | USN-6678-1 |
| Ubuntu:22.04:LTS | libgit2 | 1.1.0+dfsg.1-4.1ubuntu0.1 | UBUNTU-CVE-2023-22742 |
Affected products (as reported)
Weakness: CWE-347 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N
References
- https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq x_refsource_CONFIRM
- https://github.com/libgit2/libgit2/commit/42e5db98b963ae503229c63e44e06e439df50e56 x_refsource_MISC
- https://github.com/libgit2/libgit2/commit/cd6f679af401eda1f172402006ef8265f8bd58ea x_refsource_MISC
- https://github.com/libgit2/libgit2/releases/tag/v1.4.5 x_refsource_MISC
- https://github.com/libgit2/libgit2/releases/tag/v1.5.1 x_refsource_MISC
- https://www.libssh2.org x_refsource_MISC
- http://www.openwall.com/lists/oss-security/2023/11/06/5