CVE-2023-22742 libgit2 fails to verify SSH keys by default
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: partial
- Technology
- UbuntuDebian
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.
Upgrade path
11 packages: 11 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| alpine/libgit2(Alpine v3.17) | < 1.5.1-r0 | 1.5.1-r0 | Fixed |
| crates.io git2(crates.io) | < 0.16.1 | 0.16.1 | Fixed |
| crates.io libgit2-sys(crates.io) | < 0.13.5; >= 0.0.0-0, < 0.13.5; >= 0.14.0, < 0.14.2 | 0.13.5, 0.14.2 | Fixed |
| debian/libgit2(Debian 12) | < 1.5.1+ds-1 | 1.5.1+ds-1 | Fixed |
| debian/libgit2(Debian 13) | < 1.5.1+ds-1 | 1.5.1+ds-1 | Fixed |
| debian/libgit2(Debian 14) | < 1.5.1+ds-1 | 1.5.1+ds-1 | Fixed |
| libgit2 | < 1.4.5; = 1.5.0; = < 1.4.5; = = 1.5.0 | 1.4.5 | Fixed |
| ubuntu/libgit2(Ubuntu 20.04) | < 0.28.4+dfsg.1-2ubuntu0.1; = 0.27.7+dfsg.1-0.2build1; = 0.28.3+dfsg.1-1; = 0.28.3+dfsg.1-1ubuntu1 +1 more | 0.28.4+dfsg.1-2ubuntu0.1 | Fixed |
| ubuntu/libgit2(Ubuntu 22.04) | < 1.1.0+dfsg.1-4.1ubuntu0.1; = 1.1.0+dfsg.1-4; = 1.1.0+dfsg.1-4.1; = 1.1.0+dfsg.1-4.1build1 | 1.1.0+dfsg.1-4.1ubuntu0.1 | Fixed |
| ubuntu/libgit2(Ubuntu Pro 16.04) | < 0.24.1-2ubuntu0.2+esm2; = 0.22.2-2; = 0.23.1-1; = 0.24.1-2 +2 more | 0.24.1-2ubuntu0.2+esm2 | Fixed |
| ubuntu/libgit2(Ubuntu Pro 18.04) | < 0.26.0+dfsg.1-1.1ubuntu0.2+esm1; = 0.25.1+really0.24.6-1; = 0.26.0+dfsg.1-1.1; = 0.26.0+dfsg.1-1.1build1 +1 more | 0.26.0+dfsg.1-1.1ubuntu0.2+esm1 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| crates.io libgit2-sys(crates.io) | >= 0.14.0, < 0.14.2 | 0.14.2 |
| crates.io libgit2-sys(crates.io) | < 0.13.5 | 0.13.5 |
| crates.io git2(crates.io) | < 0.16.1 | 0.16.1 |
| crates.io libgit2-sys(crates.io) | >= 0.0.0-0, < 0.13.5 | 0.13.5 |
| debian/libgit2(Debian:12) | < 1.5.1+ds-1 | 1.5.1+ds-1 |
| debian/libgit2(Debian:13) | < 1.5.1+ds-1 | 1.5.1+ds-1 |
| debian/libgit2(Debian:14) | < 1.5.1+ds-1 | 1.5.1+ds-1 |
| libgit2 | = < 1.4.5 | No fix listed |
| libgit2 | = = 1.5.0 | No fix listed |
| ubuntu/libgit2(Ubuntu:22.04) | < 1.1.0+dfsg.1-4.1ubuntu0.1 | 1.1.0+dfsg.1-4.1ubuntu0.1 |
| libgit2 | < 1.4.5 | 1.4.5 |
| libgit2 | = 1.5.0 | No fix listed |
| alpine/libgit2(Alpine:v3.17) | < 1.5.1-r0 | 1.5.1-r0 |
| ubuntu/libgit2(Ubuntu:Pro:16.04) | < 0.24.1-2ubuntu0.2+esm2 | 0.24.1-2ubuntu0.2+esm2 |
| ubuntu/libgit2(Ubuntu:Pro:16.04) | = 0.22.2-2 | No fix listed |
| ubuntu/libgit2(Ubuntu:Pro:16.04) | = 0.23.1-1 | No fix listed |
| ubuntu/libgit2(Ubuntu:Pro:16.04) | = 0.24.1-2 | No fix listed |
| ubuntu/libgit2(Ubuntu:Pro:16.04) | = 0.24.1-2ubuntu0.2 | No fix listed |
| ubuntu/libgit2(Ubuntu:Pro:16.04) | = 0.24.1-2ubuntu0.2+esm1 | No fix listed |
| ubuntu/libgit2(Ubuntu:Pro:18.04) | < 0.26.0+dfsg.1-1.1ubuntu0.2+esm1 | 0.26.0+dfsg.1-1.1ubuntu0.2+esm1 |
| ubuntu/libgit2(Ubuntu:Pro:18.04) | = 0.25.1+really0.24.6-1 | No fix listed |
| ubuntu/libgit2(Ubuntu:Pro:18.04) | = 0.26.0+dfsg.1-1.1 | No fix listed |
| ubuntu/libgit2(Ubuntu:Pro:18.04) | = 0.26.0+dfsg.1-1.1build1 | No fix listed |
| ubuntu/libgit2(Ubuntu:Pro:18.04) | = 0.26.0+dfsg.1-1.1ubuntu0.2 | No fix listed |
| ubuntu/libgit2(Ubuntu:20.04) | < 0.28.4+dfsg.1-2ubuntu0.1 | 0.28.4+dfsg.1-2ubuntu0.1 |
Show 7 more
| Product | Affected versions | Fixed in |
|---|---|---|
| ubuntu/libgit2(Ubuntu:20.04) | = 0.27.7+dfsg.1-0.2build1 | No fix listed |
| ubuntu/libgit2(Ubuntu:20.04) | = 0.28.3+dfsg.1-1 | No fix listed |
| ubuntu/libgit2(Ubuntu:20.04) | = 0.28.3+dfsg.1-1ubuntu1 | No fix listed |
| ubuntu/libgit2(Ubuntu:20.04) | = 0.28.4+dfsg.1-2 | No fix listed |
| ubuntu/libgit2(Ubuntu:22.04) | = 1.1.0+dfsg.1-4 | No fix listed |
| ubuntu/libgit2(Ubuntu:22.04) | = 1.1.0+dfsg.1-4.1 | No fix listed |
| ubuntu/libgit2(Ubuntu:22.04) | = 1.1.0+dfsg.1-4.1build1 | No fix listed |
References
- https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq issue-tracking third-party-advisory vendor-advisory
- github.com vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com patch
- github.com product
- rustsec.org vendor-advisory
- crates.io product
- github.com
- Debian Security Tracker CVE-2023-22742 vendor-advisory
- https://github.com/libgit2/libgit2/commit/42e5db98b963ae503229c63e44e06e439df50e56 patch third-party-advisory
- https://github.com/libgit2/libgit2/commit/cd6f679af401eda1f172402006ef8265f8bd58ea patch third-party-advisory
- https://github.com/libgit2/libgit2/releases/tag/v1.4.5 issue-tracking release-notes third-party-advisory
- https://github.com/libgit2/libgit2/releases/tag/v1.5.1 issue-tracking release-notes third-party-advisory
- https://www.libssh2.org issue-tracking third-party-advisory
- www.openwall.com
- Ubuntu CVE tracker issue-tracking vendor-advisory
- USN-6678-1 vendor-advisory
- www.cve.org issue-tracking
- security.alpinelinux.org vendor-advisory
- bugs.debian.org issue-tracking