Description
libgit2 is a portable C implementation of the Git core methods provided as a linkable library with a solid API, allowing to build Git functionality into your application. Using well-crafted inputs to `git_index_add` can cause heap corruption that could be leveraged for arbitrary code execution. There is an issue in the `has_dir_name` function in `src/libgit2/index.c`, which frees an entry that should not be freed. The freed entry is later used and overwritten with potentially bad actor-controlled data leading to controlled heap corruption. Depending on the application that uses libgit2, this could lead to arbitrary code execution. This issue has been patched in version 1.6.5 and 1.7.2.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| libgit2 | libgit2 | < 1.6.5, >= 1.7.0, < 1.7.2 | — |
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.7.2+ds-1 | — |
| Debian 13 | libgit2 | 1.7.2+ds-1 | — |
| Debian 12 | libgit2 | 1.5.1+ds-1+deb12u1 | DSA-5619-1 |
| Debian 11 | libgit2 | 1.1.0+dfsg.1-4+deb11u2 | DSA-5619-1 |
| Debian 10 | libgit2 | 0.27.7+dfsg.1-0.2+deb10u2 | DLA-3742-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 SP6 | git | 2.43.0-150600.3.6.1 | SUSE-SU-2024:2579-1 |
| SLES 15 SP6 | libgit2 | 1.7.2-150600.3.3.1 | SUSE-SU-2024:2584-1 |
| SLES 15 SP5 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
| SLES 15 SP5 | libgit2 | 1.3.0-150400.3.9.1 | SUSE-SU-2024:2619-1 |
| SLES 15 SP4 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
| SLES 15 SP4 | libgit2 | 1.3.0-150400.3.9.1 | SUSE-SU-2024:2619-1 |
| SLES 15 SP3 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
| SLES 15 SP3 | libgit2 | 0.28.4-150200.3.9.1 | SUSE-SU-2024:2610-1 |
| SLES 15 SP2 | git | 2.26.2-150000.59.1 | SUSE-SU-2024:2599-1 |
| SLES 15 SP2 | libgit2 | 0.26.8-150000.3.21.1 | SUSE-SU-2024:2610-1, SUSE-SU-2024:2598-1 |
Show 14 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 12 SP5 | git | 2.26.2-27.75.1 | SUSE-SU-2024:2592-1 |
| SLES 12 SP5 | libgit2 | 0.24.1-11.5.1 | SUSE-SU-2024:2583-1 |
| SLES for SAP 15 SP4 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
| SLES for SAP 15 SP4 | libgit2 | 1.3.0-150400.3.9.1 | SUSE-SU-2024:2619-1 |
| SLES for SAP 15 SP3 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
| SLES for SAP 15 SP3 | libgit2 | 0.28.4-150200.3.9.1 | SUSE-SU-2024:2610-1 |
| SLES for SAP 15 SP2 | git | 2.26.2-150000.59.1 | SUSE-SU-2024:2599-1 |
| SLES for SAP 15 SP2 | libgit2 | 0.26.8-150000.3.21.1 | SUSE-SU-2024:2610-1, SUSE-SU-2024:2598-1 |
| SLES for SAP 12 SP5 | git | 2.26.2-27.75.1 | SUSE-SU-2024:2592-1 |
| SLE Micro 6.0 | git | 2.51.0-1.1 | SUSE-SU-2025:20721-1 |
| SLE Micro 5.5 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
| SLE HPC 15 SP4 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
| SLE HPC 15 SP4 | libgit2 | 1.3.0-150400.3.9.1 | SUSE-SU-2024:2619-1 |
| SLE HPC 15 SP3 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
| SLE HPC 15 SP3 | libgit2 | 0.28.4-150200.3.9.1 | SUSE-SU-2024:2610-1 |
| SLE HPC 15 SP2 | git | 2.26.2-150000.59.1 | SUSE-SU-2024:2599-1 |
| SLE HPC 15 SP2 | libgit2 | 0.26.8-150000.3.21.1 | SUSE-SU-2024:2610-1, SUSE-SU-2024:2598-1 |
| SUSE Manager Server Module 4.3 | libgit2 | 0.28.4-150200.3.9.1 | SUSE-SU-2024:2610-1 |
| SUSE Manager Server 4.3 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
| SUSE Manager Proxy 4.3 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
| SUSE Enterprise Storage 7.1 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
| SUSE Enterprise Storage 7.1 | libgit2 | 0.28.4-150200.3.9.1 | SUSE-SU-2024:2610-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | git | 2.45.2-2.1 | openSUSE-SU-2024:14212-1 |
| openSUSE Tumbleweed | libgit2 | 1.7.2-1.1 | openSUSE-SU-2024:13661-1 |
| openSUSE Leap 15.6 | git | 2.43.0-150600.3.6.1 | SUSE-SU-2024:2579-1 |
| openSUSE Leap 15.6 | libgit2 | 1.7.2-150600.3.3.1 | SUSE-SU-2024:2584-1 |
| openSUSE Leap 15.5 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
| openSUSE Leap 15.5 | libgit2 | 1.3.0-150400.3.9.1 | SUSE-SU-2024:2619-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Leap Micro 5.5 | git | 2.35.3-150300.10.42.1 | SUSE-SU-2024:2656-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | eza | 0.18.2-r0 | — |
| Alpine v3.24 | libgit2 | 1.7.2-r0 | — |
| Alpine v3.23 | eza | 0.18.2-r0 | — |
| Alpine v3.23 | libgit2 | 1.7.2-r0 | — |
| Alpine v3.22 | eza | 0.18.2-r0 | — |
| Alpine v3.22 | libgit2 | 1.7.2-r0 | — |
| Alpine v3.21 | eza | 0.18.2-r0 | — |
| Alpine v3.21 | libgit2 | 1.7.2-r0 | — |
| Alpine v3.20 | eza | 0.18.2-r0 | — |
| Alpine v3.20 | libgit2 | 1.7.2-r0 | — |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | libgit2 | 1.7.2-r0 | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | libgit2 +1 | 1.6.4-115.amzn2023.0.2 | ALAS2023-2024-541 |
| Amazon Linux 2023 | rust +13 | 1.68.2-1.amzn2023.0.5 | ALAS2023-2024-566 |
| Amazon Linux 2 | rust +11 | 1.68.2-1.amzn2.0.6 | ALAS2-2024-2496 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 2 (CBL-Mariner) | libgit2 | 1.6.5-1 | — |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | libgit2 | 1.7.2-r0 | — |
Advisories 19
- USN-6678-1 libgit2 vulnerabilities Ubuntu Security Notices (USN) · Jun 25, 2026
- SUSE-SU-2025:20721-1 Security update for git SUSE / openSUSE Security Updates · Mar 23, 2026
- DSA-5619-1 libgit2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-3742-1 libgit2 - security update Debian Security (DSA / DLA) · Mar 9, 2026
- SUSE-SU-2024:2579-1 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2024:2584-1 Security update for libgit2 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2024:2656-1 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2024:2598-1 Security update for libgit2 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2024:2610-1 Security update for libgit2 SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2024:2583-1 Security update for libgit2 SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:13661-1 libgit2-1_7-1.7.2-1.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2024:2599-1 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2024:2592-1 Security update for git SUSE / openSUSE Security Updates · Feb 4, 2026
- openSUSE-SU-2024:14212-1 git-2.45.2-2.1 on GA media SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2024:2619-1 Security update for libgit2 SUSE / openSUSE Security Updates · Feb 4, 2026
- WID-SEC-2025-0225 Dell PowerProtect Data Domain: Mehrere Schwachstellen BSI CERT-Bund (WID) · Oct 1, 2025
- ALAS2023-2024-566 Important: rust security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Mar 21, 2024
- ALAS2-2024-2496 Important: rust security update (Amazon Linux 2) Amazon Linux Security Center (ALAS) · Mar 18, 2024
- ALAS2023-2024-541 Important: libgit2 security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Mar 5, 2024
References
- https://github.com/libgit2/libgit2/security/advisories/GHSA-j2v7-4f6v-gpg8
- https://github.com/libgit2/libgit2/releases/tag/v1.6.5
- https://github.com/libgit2/libgit2/releases/tag/v1.7.2
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S635BGHHZUMRPI7QOXOJ45QHDD5FFZ3S/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4M3P7WIEPXNRLBINQRJFXUSTNKBCHYC7/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7CNDW3PF6NHO7OXNM5GN6WSSGAMA7MZE/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/Z6MXOX7I43OWNN7R6M54XLG6U5RXY244/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZGNHOEE2RBLH7KCJUPUNYG4CDTW4HTBT/
- https://lists.debian.org/debian-lts-announce/2024/02/msg00012.html