CVE-2024-24575

libgit2 is vulnerable to a denial of service attack in `git_revparse_single`

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_revparse_single` can cause the function to enter an infinite loop, potentially causing a Denial of Service attack in the calling application. The revparse function in `src/libgit2/revparse.c` uses a loop to parse the user-provided spec string. There is an edge-case during parsing that allows a bad actor to force the loop conditions to access arbitrary memory. Potentially, this could also leak memory if the extracted rev spec is reflected back to the attacker. As such, libgit2 versions before 1.4.0 are not affected. Users should upgrade to version 1.6.5 or 1.7.2.

Category

7.5
CVSS
Severity: High
CVSS 3.1 •
EPSS 1.00% Top 25%
Third-Party Advisory github.com
Affected: libgit2 libgit2
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2024-24575?
CVE-2024-24575 has been scored as a high severity vulnerability.
How to fix CVE-2024-24575?
To fix CVE-2024-24575, 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-24575 being actively exploited in the wild?
As for now, there are no information to confirm that CVE-2024-24575 is being actively exploited. According to its EPSS score, there is a ~1% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2024-24575?
CVE-2024-24575 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.