CVE-2024-24577 json
libgit2 is vulnerable to arbitrary code execution due to heap corruption in `git_index_add`
published 2024-02-06 2 y ago modified 2026-07-18 3 mo ago also EUVD-2024-21982 , JLSEC-2025-186
- cvss
- 8.6
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.5%
- EPSS 1.5% chance of exploitation in 30 days, percentile 75%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- julia LibGit2_jll 1.7.2+0
- libgit2 libgit2 1.6.5, 1.7.2
- libgit2 Debian 12 1.5.1+ds-1+deb12u1
- libgit2 Debian 14, Debian 13 1.7.2+ds-1
debian advisories DEBIAN-CVE-2024-24577
- libgit2 Ubuntu 20.04 LTS 0.28.4+dfsg.1-2ubuntu0.1
- libgit2 Ubuntu 22.04 LTS 1.1.0+dfsg.1-4.1ubuntu0.1
- libgit2 Ubuntu Pro 16.04 LTS 0.24.1-2ubuntu0.2+esm2
- libgit2 Ubuntu Pro 18.04 LTS 0.26.0+dfsg.1-1.1ubuntu0.2+esm1
ubuntu advisories UBUNTU-CVE-2024-24577
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- git Linux Micro 6.0 2.51.0-1.1
- git SLES for SAP 15 SP4, SLES for SAP 15 SP3, SLES 15 SP4-LTSS +12 more 2.35.3-150300.10.42.1
- libgit2 SLES for SAP 15 SP4, SLES 15 SP4-LTSS, SLE Module for Development Tools 15 SP5 +3 more 1.3.0-150400.3.9.1
- libgit2 SLES for SAP 15 SP3, SLES for SAP 15 SP2, SLES 15 SP3-LTSS +5 more 0.28.4-150200.3.9.1
- git SLES for SAP 12 SP5, SLES 12 SP5, SLE Software Development Kit 12 SP5 2.26.2-27.75.1
- libgit2 SLE Module for Development Tools 15 SP6, openSUSE Leap 15.6 1.7.2-150600.3.3.1
- libgit2 SLE Software Development Kit 12 SP5 0.24.1-11.5.1
- git SLE Module for Development Tools 15 SP6, SLE Module for Basesystem 15 SP6, openSUSE Leap 15.6 2.43.0-150600.3.6.1
suse advisories SUSE-SU-2025:20721-1SUSE-SU-2024:2656-1SUSE-SU-2024:2619-1SUSE-SU-2024:2610-1SUSE-SU-2024:2599-1SUSE-SU-2024:2598-1
- git openSUSE Tumbleweed 2.45.2-2.1
- libgit2 openSUSE Tumbleweed 1.7.2-1.1
opensuse advisories openSUSE-SU-2024:14212-1openSUSE-SU-2024:13661-1
- eza Alpine 3.24, Alpine 3.23, Alpine 3.22 +2 more 0.18.2-r0
- libgit2 Alpine 3.24, Alpine 3.23, Alpine 3.22 +3 more 1.7.2-r0
alpine advisories ALPINE-CVE-2024-24577
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2024-24577 updated cvss 9.8
libgit2: arbitrary code execution due to heap corruption in git_index_add
-
Red Hat Enterprise Linux 7 libgit2 Red Hat Enterprise Linux 8 rls, rust, cargo, clippy, libgit2, rustfmt, +9 more Red Hat Enterprise Linux 9 rust, cargo, clippy, rustfmt, rust-gdb, rust-src, +8 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 18 mo ago
Exploit prediction
1.55% chance of exploitation in the next 30 days, higher than 75% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.6 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L |
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| julia | LibGit2_jll | <1.7.2+0 |
1.7.2+0 |
Affected products
- libgit2 libgit2
Classification
References
-
github.com
/libgit2/libgit2/security/advisories/GHSA-j2v7-4f6v-gpg8
third-party-advisory, web
-
github.com
/libgit2/libgit2/releases/tag/v1.6.5
release-notes, web
-
github.com
/libgit2/libgit2/releases/tag/v1.7.2
release-notes, web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/S635BGHHZUMRPI7QOXOJ45QHDD5FFZ3S/
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/4M3P7WIEPXNRLBINQRJFXUSTNKBCHYC7/
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/7CNDW3PF6NHO7OXNM5GN6WSSGAMA7MZE/
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/Z6MXOX7I43OWNN7R6M54XLG6U5RXY244/
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/ZGNHOEE2RBLH7KCJUPUNYG4CDTW4HTBT/
web
-
lists.debian.org
/debian-lts-announce/2024/02/msg00012.html
web
Sources
- CVE List CVE-2024-24577
- NVD CVE-2024-24577
- OSV JLSEC-2025-186
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.