CVE-2024-24575
📋 TL;DR
CVE-2024-24575 is a vulnerability in libgit2 where specially crafted inputs to the git_revparse_single function can cause an infinite loop, leading to denial of service. It may also allow memory access and potential information leakage. Applications using vulnerable libgit2 versions before 1.6.5 or 1.7.2 are affected.
💻 Affected Systems
- libgit2
- Applications embedding libgit2 library
📦 What is this software?
Libgit2 by Libgit2
Libgit2 by Libgit2
⚠️ Risk & Real-World Impact
Worst Case
Complete denial of service through infinite loop consumption of CPU resources, potential memory exhaustion, and possible information leakage if memory contents are exposed.
Likely Case
Denial of service causing application unresponsiveness or crashes when processing malicious git revision specifications.
If Mitigated
Minimal impact if input validation or rate limiting prevents malicious payloads from reaching vulnerable function.
🎯 Exploit Status
Exploitation requires ability to provide crafted inputs to the vulnerable function, typically through git operations. No public exploit code identified.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.6.5 or 1.7.2
Vendor Advisory: https://github.com/libgit2/libgit2/security/advisories/GHSA-54mf-x2rh-hq9v
Restart Required: Yes
Instructions:
1. Identify libgit2 version in use. 2. Update to version 1.6.5 or 1.7.2 using package manager or source compilation. 3. Rebuild and restart applications using libgit2.
🔧 Temporary Workarounds
Input validation
allValidate and sanitize git revision specifications before passing to libgit2 functions
Rate limiting
allImplement rate limiting on git operations to prevent DoS attacks
🧯 If You Can't Patch
- Implement strict input validation for all git revision specifications
- Isolate applications using libgit2 behind firewalls with limited network access
🔍 How to Verify
Check if Vulnerable:
Check libgit2 version: pkg-config --modversion libgit2 or check application dependencies
Check Version:
pkg-config --modversion libgit2
Verify Fix Applied:
Confirm version is 1.6.5 or higher, or 1.7.2 or higher
📡 Detection & Monitoring
Log Indicators:
- Unusually long processing times for git operations
- Application crashes related to git_revparse_single
- High CPU usage from processes using libgit2
Network Indicators:
- Unusual patterns of git protocol requests
- Repeated git operations from single sources
SIEM Query:
Process logs for libgit2-related applications showing abnormal resource consumption or crashes
🔗 References
- https://github.com/libgit2/libgit2/commit/add2dabb3c16aa49b33904dcdc07cd915efc12fa
- https://github.com/libgit2/libgit2/releases/tag/v1.6.5
- https://github.com/libgit2/libgit2/releases/tag/v1.7.2
- https://github.com/libgit2/libgit2/security/advisories/GHSA-54mf-x2rh-hq9v
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4M3P7WIEPXNRLBINQRJFXUSTNKBCHYC7/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7CNDW3PF6NHO7OXNM5GN6WSSGAMA7MZE/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S635BGHHZUMRPI7QOXOJ45QHDD5FFZ3S/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/Z6MXOX7I43OWNN7R6M54XLG6U5RXY244/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZGNHOEE2RBLH7KCJUPUNYG4CDTW4HTBT/
- https://github.com/libgit2/libgit2/commit/add2dabb3c16aa49b33904dcdc07cd915efc12fa
- https://github.com/libgit2/libgit2/releases/tag/v1.6.5
- https://github.com/libgit2/libgit2/releases/tag/v1.7.2
- https://github.com/libgit2/libgit2/security/advisories/GHSA-54mf-x2rh-hq9v
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4M3P7WIEPXNRLBINQRJFXUSTNKBCHYC7/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7CNDW3PF6NHO7OXNM5GN6WSSGAMA7MZE/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S635BGHHZUMRPI7QOXOJ45QHDD5FFZ3S/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/Z6MXOX7I43OWNN7R6M54XLG6U5RXY244/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZGNHOEE2RBLH7KCJUPUNYG4CDTW4HTBT/