CVE-2024-24577: libgit2 Heap-based Buffer Overflow
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 74.6% of scored vulnerabilities.
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
6 scores · 6 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
EPSS trend
Probability
1.55%
Chance of exploitation in the next 30 days
Percentile
75%
Versus all other CVEs
30-day change
0.00 pp
From 1.55% on 19-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-122Heap-based Buffer OverflowA heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().
- 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. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
Affected systems
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
Chainguard2 products
- libgit2< 1.7.2-r0
- libgit2-1.5< 1.7.2-r0
Debian1 product
- libgit2< 1.7.2+ds-1 | < 1.1.0+dfsg.1-4+deb11u2 | < 1.5.1+ds-1+deb12u1 | < 0.27.7+dfsg.1-0.2+deb10u2
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
7 vendors · 46 products
References
25 links- github.com/libgit2/libgit2/security/advisories/GHSA-j2v7-4f6v-gpg8X Refsource CONFIRMREPORTAdvisoryThird Party Advisory