CVE-2024-24577: libgit2 is vulnerable to arbitrary code execution due to heap corruption in `git_index_add`
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 gitindexadd can cause heap corruption that could be leveraged for arbitrary code execution. There is an issue in the hasdirname 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.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2024-24577?
CVE-2024-24577 is classified as a critical vulnerability due to its potential for arbitrary code execution.
How do I fix CVE-2024-24577?
To remediate CVE-2024-24577, upgrade to a version of libgit2 that is 1.6.5 or newer.
What versions of libgit2 are affected by CVE-2024-24577?
CVE-2024-24577 affects libgit2 versions before 1.6.5 and between 0.24.1 and 1.7.2.
What are the risks associated with CVE-2024-24577?
Exploitation of CVE-2024-24577 could lead to heap corruption, allowing an attacker to execute arbitrary code.
Is CVE-2024-24577 present in Debian or Ubuntu distributions?
Yes, CVE-2024-24577 is present in several Debian and Ubuntu packages of libgit2 prior to the specified remedial versions.