CVE-2024-24577: libgit2 is vulnerable to arbitrary code execution due to heap corruption in `git_index_add`
Vulnerability summary
CVE-2024-24577 is a critical (CVSS 9.8) Heap-based Buffer Overflow vulnerability in libgit2. EPSS estimates a 1.55% chance of exploitation in the next 30 days, higher than 75.9% of scored vulnerabilities.
Severe, CVSS 8.6 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 2% (FIRST, 05-12-2026)
CIRCL last checked 05-12-2026
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 5 · Related 8Timeline
- 06-02-2024PublishedVulnerability first disclosed.
- 15-05-2025Last modifiedVulnerability information updated.
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.
CVSS metrics
7 scores · 7 sources · 1 version- CVE.orgCNA8.6HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:LDiffers
- OSV · UbuntuEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · DebianEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- OSV · WolfiEcosystem advisory · calculated8.6HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:LDiffers
- OSV · ChainguardEcosystem advisory · calculated8.6HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:LDiffers
- OSV · AlpineEcosystem advisory · calculated9.8CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS trend
Probability
1.55%
Chance of exploitation in the next 30 days
Percentile
76%
Versus all other CVEs
30-day change
No change 0.00 pp
From 1.55% on 05-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-122Heap-based Buffer OverflowThe product writes past the end of a buffer that was allocated on the heap.
- CWE-119Improper Restriction of Operations within the Bounds of a Memory BufferThe product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary.
Affected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Suse35 products
- git&distro=SUSE Enterprise Storage 7.1< 2.35.3-150300.10.42.1
- git&distro=SUSE Linux Enterprise High Performance Computing 15 SP2-LTSS< 2.26.2-150000.59.1
- git&distro=SUSE Linux Enterprise High Performance Computing 15 SP3-LTSS< 2.35.3-150300.10.42.1
- git&distro=SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS< 2.35.3-150300.10.42.1
- git&distro=SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS< 2.35.3-150300.10.42.1
Opensuse5 products
- git&distro=openSUSE Leap 15.5< 2.35.3-150300.10.42.1
- git&distro=openSUSE Leap 15.6< 2.43.0-150600.3.6.1
- git&distro=openSUSE Leap Micro 5.5< 2.35.3-150300.10.42.1
- git&distro=openSUSE Tumbleweed< 2.45.2-2.1
- libgit2&distro=openSUSE Leap 15.5< 1.3.0-150400.3.9.1
Alpine2 products
- eza< 0.18.2-r0
- libgit2≥ 1.7.0, < 1.7.2-r0
Chainguard2 products
- libgit2< 1.7.2-r0
- libgit2-1.5< 1.7.2-r0
Debian1 product
- libgit2< 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
Libgit21 product
- libgit2< 1.6.5 | ≥ 1.7.0, < 1.7.2
Ubuntu1 product
- libgit2< 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
Wolfi1 product
- libgit2< 1.7.2-r0
8 vendors · 48 products
References
26 links- github.com/libgit2/libgit2/security/advisories/GHSA-j2v7-4f6v-gpg8X Refsource CONFIRMREPORTAdvisoryThird Party Advisory