CVE-2024-24577

libgit2 is vulnerable to arbitrary code execution due to heap corruption in `git_index_add`

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.

Categories

8.6
CVSS
Severity: High
CVSS 3.1 •
EPSS 0.16%
Third-Party Advisory github.com
Affected: libgit2 libgit2
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2024-24577?
CVE-2024-24577 has been scored as a high severity vulnerability.
How to fix CVE-2024-24577?
To fix CVE-2024-24577, make sure you are using an up-to-date version of the affected component(s) by checking the vendor release notes. As for now, there are no other specific guidelines available.
Is CVE-2024-24577 being actively exploited in the wild?
As for now, there are no information to confirm that CVE-2024-24577 is being actively exploited. According to its EPSS score, there is a ~0% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2024-24577?
CVE-2024-24577 affects libgit2 libgit2.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.