CVE-2024-24575
libgit2 is vulnerable to a denial of service attack in `git_revparse_single`
Reported by github_m · Published February 6, 2024
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| rustfmt | Amazon Linux | 1.68.2-1.amzn2023.0.5 |
| rust-debugger-common | Amazon Linux | 1.68.2-1.amzn2023.0.5, 1.68.2-1.amzn2.0.6 |
| libgit2 | Amazon Linux | 1.6.4-115.amzn2023.0.2 |
| rust-analyzer | Amazon Linux | 1.68.2-1.amzn2023.0.5 |
| rust-doc | Amazon Linux | 1.68.2-1.amzn2.0.6 |
| libgit2-1.5 | Chainguard | 1.7.2-r0 |
| rust-std-static | Amazon Linux | 1.68.2-1.amzn2023.0.5, 1.68.2-1.amzn2.0.6 |
| libgit2 | Chainguard | 1.7.2-r0 |
| clippy | Amazon Linux | 1.68.2-1.amzn2023.0.5 |
| rust | Amazon Linux | 1.68.2-1.amzn2023.0.5 |
| rust-src | Amazon Linux | 1.68.2-1.amzn2023.0.5 |
| libgit2-devel | Amazon Linux | 1.6.4-115.amzn2023.0.2 |
2 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| libgit2 | libgit2 | >= 1.4.0, < 1.6.5, >= 1.7.0, < 1.7.2 |
| amazon:2023 | rustfmt | 0 |
| amazon:2 | rust-debugger-common | 0 |
| amazon:2023 | libgit2 | 0 |
| amazon:2023 | rust-analyzer | 0 |
| amazon:2 | rust-doc | 0 |
| amazon:2023 | rust-debugger-common | 0 |
| chainguard | libgit2-1.5 | 0 |
| amazon:2023 | rust-std-static | 0 |
| chainguard | libgit2 | 0 |
| amazon:2023 | clippy | 0 |
| amazon:2023 | rust | 0 |
| amazon:2 | rust-std-static | 0 |
| amazon:2023 | rust-src | 0 |
| amazon:2023 | libgit2-devel | 0 |
| amazon:2023 | cargo | 0 |
| amazon:2 | clippy | 0 |
| alpine | libgit2 | 0 |
| amazon:2 | rust-toolset | 0 |
| amazon:2023 | rust-lldb | 0 |
…and 14 more
Timeline
- Feb 6, 2024 CVE Published
- Feb 6, 2024 PoC Published (2 in total, the first dated here)
- Feb 8, 2024 EPSS Score (30 in total, the first dated here)
- Oct 4, 2024 Coalition ESS Score (12 in total, the first dated here)
- Jan 16, 2026 Security Advisory
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-24575
vulnetix vdb fixes CVE-2024-24575
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-24575/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/libgit2/libgit2/security/advisories/GHSA-54mf-x2rh-hq9v x_refsource_CONFIRM
- https://github.com/libgit2/libgit2/commit/add2dabb3c16aa49b33904dcdc07cd915efc12fa x_refsource_MISC
- https://github.com/libgit2/libgit2/releases/tag/v1.6.5 x_refsource_MISC
- https://github.com/libgit2/libgit2/releases/tag/v1.7.2 x_refsource_MISC