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 products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| libgit2 | libgit2 | < 1.4.5, = 1.5.0 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | libgit2 | 1.5.1+ds-1 | — |
| Debian 13 | libgit2 | 1.5.1+ds-1 | — |
| Debian 12 | libgit2 | 1.5.1+ds-1 | — |
| Debian 10 | libgit2 | 0.27.7+dfsg.1-0.2+deb10u1 | DLA-3340-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 22.04 LTS | libgit2 | 1.1.0+dfsg.1-4.1ubuntu0.1 | USN-6678-1 |
| Ubuntu 20.04 LTS | libgit2 | 0.28.4+dfsg.1-2ubuntu0.1 | USN-6678-1 |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 18.04 LTS | libgit2 | 0.26.0+dfsg.1-1.1ubuntu0.2+esm1 | USN-6678-1 |
| Ubuntu Pro 16.04 LTS | libgit2 | 0.24.1-2ubuntu0.2+esm2 | USN-6678-1 |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP4 | libgit2 | 1.3.0-150400.3.6.1 | SUSE-SU-2023:1788-1 |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLE Real Time 15 SP3 | libgit2 | 0.28.4-150200.3.6.1 | SUSE-SU-2023:1909-1 |
| SUSE Manager Server Module 4.3 | libgit2 | 0.28.4-150200.3.6.1 | SUSE-SU-2023:1909-1 |
| SUSE Manager Server Module 4.2 | libgit2 | 0.28.4-150200.3.6.1 | SUSE-SU-2023:1909-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | libgit2 | 1.5.1-1.1 | openSUSE-SU-2024:12632-1 |
| openSUSE Leap 15.4 | libgit2 | 0.26.8-150000.3.18.1 | SUSE-SU-2023:1909-1, SUSE-SU-2023:1788-1, SUSE-SU-2023:1570-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.17 | libgit2 | 1.5.1-r0 | — |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 2 (CBL-Mariner) | rust | 1.68.0-1 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| crates.io | git2 | < 0.16.1 | 0.16.1 | GHSA-m4ch-rfv5-x5g3 |
| crates.io | libgit2-sys | >= 0.14.0, < 0.14.2 | 0.14.2 | GHSA-m4ch-rfv5-x5g3 |
| crates.io | libgit2-sys | < 0.13.5 | 0.13.5 | GHSA-m4ch-rfv5-x5g3 |
| crates.io | libgit2-sys | >= 0.0.0-0, < 0.13.5 · >= 0.14.0, < 0.14.2 | 0.13.5, 0.14.2 | RUSTSEC-2023-0003 |
Advisories 8
- USN-6678-1 libgit2 vulnerabilities Ubuntu Security Notices (USN) · Jun 25, 2026
- DLA-3340-1 libgit2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- SUSE-SU-2023:1788-1 Security update for libgit2 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2023:1570-1 Security update for libgit2 SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:12632-1 libgit2-1.5.1-1.1 on GA media SUSE / openSUSE Security Updates · May 7, 2025
- SUSE-SU-2023:1909-1 Security update for libgit2 SUSE / openSUSE Security Updates · May 2, 2025
- SSA-806742 SSA-806742: Multiple Vulnerabilities in SCALANCE XCM-/XRM-300 before V2.4 Siemens ProductCERT · Feb 13, 2024
- ICSA-24-046-11 Siemens SCALANCE XCM-/XRM-300 CISA ICS & IT advisories · Feb 13, 2024
References
- 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