# CVE-2024-24577: libgit2 is vulnerable to arbitrary code execution due to heap corruption in \`git\_index\_add\`

- Priority: **Prioritise**
- Reason: Severe, CVSS 8.6 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 2% (FIRST, 05-12-2026)
- Next step: Check applicability: affected before 1.6.5, 1.7.2 (CNA); fix release not confirmed
- Status: published
- Published: 2024-02-06 · Modified: 2025-05-15
- Aliases: SUSE-SU-2024:2579-1, SUSE-SU-2024:2583-1, SUSE-SU-2024:2592-1, SUSE-SU-2024:2598-1, SUSE-SU-2024:2599-1, SUSE-SU-2024:2610-1, SUSE-SU-2024:2619-1, SUSE-SU-2024:2656-1, UBUNTU-CVE-2024-24577, DEBIAN-CVE-2024-24577, DLA-3742-1, DSA-5619-1, CGA-7qgh-m6fr-rqvj, CGA-7qxg-9x7p-mwgf, openSUSE-SU-2024:14212-1, CGA-8hpm-7mjf-w35g, CGA-hgpx-j7rh-7crv, ALPINE-CVE-2024-24577
- Record: https://cvemate.com/vulnerability/CVE-2024-24577 · JSON: https://cvemate.com/vulnerability/CVE-2024-24577/json

## Description

```text
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.
```

## Signals

- CVSS: 9.8 critical (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS: 1.546%, percentile 75.912%, as of 2026-12-05
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 48)

- alpine eza (Alpine Linux): \< 0.18.2-r0
- alpine libgit2 (Alpine Linux): ≥ 1.7.0, \< 1.7.2-r0
- chainguard libgit2 (Chainguard): \< 1.7.2-r0
- chainguard libgit2-1.5 (Chainguard): \< 1.7.2-r0
- wolfi libgit2 (Wolfi): \< 1.7.2-r0
- debian libgit2 (Debian): \< 1.7.2+ds-1 \| \< 0.27.7+dfsg.1-0.2+deb10u2 \| \< 1.1.0+dfsg.1-4+deb11u2 \| \< 1.5.1+ds-1+deb12u1
- ubuntu libgit2 (Ubuntu): \< 0.24.1-2ubuntu0.2+esm2 \| \< 0.26.0+dfsg.1-1.1ubuntu0.2+esm1 \| \< 0.28.4+dfsg.1-2ubuntu0.1 \| \< 1.1.0+dfsg.1-4.1ubuntu0.1
- libgit2 libgit2: \< 1.6.5 \| ≥ 1.7.0, \< 1.7.2
- opensuse git&distro=openSUSE Leap 15.5 (openSUSE): \< 2.35.3-150300.10.42.1
- opensuse git&distro=openSUSE Leap 15.6 (openSUSE): \< 2.43.0-150600.3.6.1
- opensuse git&distro=openSUSE Leap Micro 5.5 (openSUSE): \< 2.35.3-150300.10.42.1
- opensuse git&distro=openSUSE Tumbleweed (openSUSE): \< 2.45.2-2.1
- opensuse libgit2&distro=openSUSE Leap 15.5 (openSUSE): \< 1.3.0-150400.3.9.1
- suse git&distro=SUSE Enterprise Storage 7.1 (SUSE Linux Enterprise): \< 2.35.3-150300.10.42.1
- suse git&distro=SUSE Linux Enterprise High Performance Computing 15 SP2-LTSS (SUSE Linux Enterprise): \< 2.26.2-150000.59.1
- suse git&distro=SUSE Linux Enterprise High Performance Computing 15 SP3-LTSS (SUSE Linux Enterprise): \< 2.35.3-150300.10.42.1
- suse git&distro=SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS (SUSE Linux Enterprise): \< 2.35.3-150300.10.42.1
- suse git&distro=SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS (SUSE Linux Enterprise): \< 2.35.3-150300.10.42.1
- suse git&distro=SUSE Linux Enterprise Micro 5.5 (SUSE Linux Enterprise): \< 2.35.3-150300.10.42.1
- suse git&distro=SUSE Linux Enterprise Module for Basesystem 15 SP5 (SUSE Linux Enterprise): \< 2.35.3-150300.10.42.1

## References (first 20 of 26)

- <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>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20242579-1/>
- <https://bugzilla.suse.com/1219660>
- <https://www.suse.com/security/cve/CVE-2024-24577>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20242583-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20242592-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20242598-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20242599-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20242610-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20242619-1/>
- <https://www.suse.com/support/update/announcement/2024/suse-su-20242656-1/>
- <https://ubuntu.com/security/CVE-2024-24577>

---

Data as of 2026-12-05T18:17:24.586Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
