cve.bz

CVE-2024-24577 libgit2 libgit2: Heap-based Buffer Overflow

9.8 criticalEPSS 1.5%

Critical (9.8) in libgit2 libgit2. EPSS 1.5% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
1.5% (unchanged from 1.5% a week ago; 1.5% 30 days ago) estimated probability of exploitation activity in the next 30 days; 76th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: partial, assessed 2025-05-08. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer
CWE-122 Heap-based Buffer Overflow
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-24577 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-24577?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-24577?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-24577 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
libgit2:libgit2before 1.6.5
libgit2:libgit2from 1.7.0 before 1.7.2

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10libgit20.27.7+dfsg.1-0.2+deb10u2DLA-3742-1
Debian11libgit21.1.0+dfsg.1-4+deb11u2DSA-5619-1
Debian12libgit21.5.1+ds-1+deb12u1DEBIAN-CVE-2024-24577 DSA-5619-1
Debian13, 14libgit21.7.2+ds-1DEBIAN-CVE-2024-24577
Ubuntu20.04:LTSlibgit20.28.4+dfsg.1-2ubuntu0.1UBUNTU-CVE-2024-24577 USN-6678-1
Ubuntu22.04:LTSlibgit21.1.0+dfsg.1-4.1ubuntu0.1UBUNTU-CVE-2024-24577 USN-6678-1
UbuntuPro:16.04:LTSlibgit20.24.1-2ubuntu0.2+esm2UBUNTU-CVE-2024-24577 USN-6678-1
UbuntuPro:18.04:LTSlibgit20.26.0+dfsg.1-1.1ubuntu0.2+esm1UBUNTU-CVE-2024-24577 USN-6678-1
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP2-LTSS, Linux Enterprise High Performance Computing 15 SP3-LTSS and 5 morelibgit20.28.4-150200.3.9.1SUSE-SU-2024:2610-1
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP3-LTSS, Linux Enterprise High Performance Computing 15 SP4-ESPOS and 10 moregit2.35.3-150300.10.42.1SUSE-SU-2024:2656-1
SUSELinux Enterprise High Performance Computing 15 SP2-LTSS, Linux Enterprise Server 15 SP2-LTSS, Linux Enterprise Server for SAP Applications 15 SP2git2.26.2-150000.59.1SUSE-SU-2024:2599-1
SUSELinux Enterprise High Performance Computing 15 SP2-LTSS, Linux Enterprise Server 15 SP2-LTSS, Linux Enterprise Server for SAP Applications 15 SP2libgit20.26.8-150000.3.21.1SUSE-SU-2024:2598-1
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise Module for Development Tools 15 SP5 and 2 morelibgit21.3.0-150400.3.9.1SUSE-SU-2024:2619-1
SUSELinux Enterprise Module for Basesystem 15 SP6, Linux Enterprise Module for Development Tools 15 SP6git2.43.0-150600.3.6.1SUSE-SU-2024:2579-1
SUSELinux Enterprise Module for Development Tools 15 SP6libgit21.7.2-150600.3.3.1SUSE-SU-2024:2584-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5, Linux Enterprise Software Development Kit 12 SP5git2.26.2-27.75.1SUSE-SU-2024:2592-1
SUSELinux Enterprise Software Development Kit 12 SP5libgit20.24.1-11.5.1SUSE-SU-2024:2583-1
SUSELinux Micro 6.0git2.51.0-1.1SUSE-SU-2025:20721-1
openSUSELeap 15.5libgit21.3.0-150400.3.9.1SUSE-SU-2024:2619-1
openSUSELeap 15.5, Leap Micro 5.5git2.35.3-150300.10.42.1SUSE-SU-2024:2656-1
openSUSELeap 15.6git2.43.0-150600.3.6.1SUSE-SU-2024:2579-1
openSUSELeap 15.6libgit21.7.2-150600.3.3.1SUSE-SU-2024:2584-1
openSUSETumbleweedgit2.45.2-2.1openSUSE-SU-2024:14212-1
openSUSETumbleweedlibgit21.7.2-1.1openSUSE-SU-2024:13661-1
Alpinev3.19, v3.20, v3.21 and 3 morelibgit21.7.2-r0ALPINE-CVE-2024-24577
Alpinev3.20, v3.21, v3.22 and 2 moreeza0.18.2-r0ALPINE-CVE-2024-24577
Azure Linux2libgit21.6.5-1AZL-34274
Alpaquitastreamlibgit21.7.2-r0BELL-CVE-2024-24577

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE · Alpine · Alpaquita.

Red Hat

Red Hat rates this Important.

Red Hat's statement

Cargo in Red Hat Enterprise Linux 8 & 9 does use a bundled libgit2. However, cargo does not call git_index_add directly, and the only indirect call I can find is via git_reset, which does not involve any externally-provided paths. Therefore, Red Hat Enterprise Linux should be Not Affected by this CVE.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options don't meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 7libgit2Not affected
Red Hat Enterprise Linux 8libgit2Not affected
Red Hat Enterprise Linux 8rust-toolset:rhel8/rustNot affected
Red Hat Enterprise Linux 9rustNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2024-24577.

Attack patterns (CAPEC)

  • CAPEC-92 Forced Integer Overflow Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-119 (12).

References

Check your stackJSON