CVE-2024-24575 libgit2 is vulnerable to a denial of service attack in `git_revparse_single`
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: partial
- Technology
- Debian
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.
Upgrade path
10 packages: 10 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| alpine/libgit2(Alpine v3.19) | >= 1.7.0, < 1.7.2-r0 | 1.7.2-r0 | Fixed |
| alpine/libgit2(Alpine v3.20) | >= 1.7.0, < 1.7.2-r0 | 1.7.2-r0 | Fixed |
| alpine/libgit2(Alpine v3.21) | >= 1.7.0, < 1.7.2-r0 | 1.7.2-r0 | Fixed |
| alpine/libgit2(Alpine v3.22) | >= 1.7.0, < 1.7.2-r0 | 1.7.2-r0 | Fixed |
| alpine/libgit2(Alpine v3.23) | >= 1.7.0, < 1.7.2-r0 | 1.7.2-r0 | Fixed |
| alpine/libgit2(Alpine v3.24) | >= 1.7.0, < 1.7.2-r0 | 1.7.2-r0 | Fixed |
| debian/libgit2(Debian 12) | < 1.5.1+ds-1+deb12u1; = 1.5.1+ds-1 | 1.5.1+ds-1+deb12u1 | Fixed |
| debian/libgit2(Debian 13) | < 1.7.2+ds-1 | 1.7.2+ds-1 | Fixed |
| debian/libgit2(Debian 14) | < 1.7.2+ds-1 | 1.7.2+ds-1 | Fixed |
| libgit2 | = >= 1.4.0, < 1.6.5; = >= 1.7.0, < 1.7.2; >= 1.4.0, < 1.6.5; >= 1.7.0, < 1.7.2 | 1.6.5, 1.7.2 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| debian/libgit2(Debian:12) | < 1.5.1+ds-1+deb12u1 | 1.5.1+ds-1+deb12u1 |
| debian/libgit2(Debian:12) | = 1.5.1+ds-1 | No fix listed |
| debian/libgit2(Debian:13) | < 1.7.2+ds-1 | 1.7.2+ds-1 |
| debian/libgit2(Debian:14) | < 1.7.2+ds-1 | 1.7.2+ds-1 |
| libgit2 | = >= 1.4.0, < 1.6.5 | No fix listed |
| libgit2 | = >= 1.7.0, < 1.7.2 | No fix listed |
| libgit2 | >= 1.4.0, < 1.6.5 | 1.6.5 |
| libgit2 | >= 1.7.0, < 1.7.2 | 1.7.2 |
| alpine/libgit2(Alpine:v3.19) | >= 1.7.0, < 1.7.2-r0 | 1.7.2-r0 |
| alpine/libgit2(Alpine:v3.20) | >= 1.7.0, < 1.7.2-r0 | 1.7.2-r0 |
| alpine/libgit2(Alpine:v3.21) | >= 1.7.0, < 1.7.2-r0 | 1.7.2-r0 |
| alpine/libgit2(Alpine:v3.22) | >= 1.7.0, < 1.7.2-r0 | 1.7.2-r0 |
| alpine/libgit2(Alpine:v3.23) | >= 1.7.0, < 1.7.2-r0 | 1.7.2-r0 |
| alpine/libgit2(Alpine:v3.24) | >= 1.7.0, < 1.7.2-r0 | 1.7.2-r0 |
References
- Debian Security Tracker CVE-2024-24575 vendor-advisory
- https://github.com/libgit2/libgit2/security/advisories/GHSA-54mf-x2rh-hq9v third-party-advisory
- https://github.com/libgit2/libgit2/commit/add2dabb3c16aa49b33904dcdc07cd915efc12fa patch
- https://github.com/libgit2/libgit2/releases/tag/v1.6.5 release-notes
- https://github.com/libgit2/libgit2/releases/tag/v1.7.2 release-notes
- lists.fedoraproject.org
- lists.fedoraproject.org
- lists.fedoraproject.org
- lists.fedoraproject.org
- lists.fedoraproject.org
- security.alpinelinux.org vendor-advisory
- bugs.debian.org issue-tracking