VDB

CVE-2024-24575

CVE-2024-24575 PUBLISHED CVSS 7.5 HIGH

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.

PackageEcosystemFixed in
rustfmtAmazon Linux1.68.2-1.amzn2023.0.5
rust-debugger-commonAmazon Linux1.68.2-1.amzn2023.0.5, 1.68.2-1.amzn2.0.6
libgit2Amazon Linux1.6.4-115.amzn2023.0.2
rust-analyzerAmazon Linux1.68.2-1.amzn2023.0.5
rust-docAmazon Linux1.68.2-1.amzn2.0.6
libgit2-1.5Chainguard1.7.2-r0
rust-std-staticAmazon Linux1.68.2-1.amzn2023.0.5, 1.68.2-1.amzn2.0.6
libgit2Chainguard1.7.2-r0
clippyAmazon Linux1.68.2-1.amzn2023.0.5
rustAmazon Linux1.68.2-1.amzn2023.0.5
rust-srcAmazon Linux1.68.2-1.amzn2023.0.5
libgit2-develAmazon Linux1.6.4-115.amzn2023.0.2

2 more packages have a fixed version. See every fix in Lookup.

Risk scores

CVSS 3.1
7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected products

VendorProductVersions
libgit2libgit2>= 1.4.0, < 1.6.5, >= 1.7.0, < 1.7.2
amazon:2023rustfmt0
amazon:2rust-debugger-common0
amazon:2023libgit20
amazon:2023rust-analyzer0
amazon:2rust-doc0
amazon:2023rust-debugger-common0
chainguardlibgit2-1.50
amazon:2023rust-std-static0
chainguardlibgit20
amazon:2023clippy0
amazon:2023rust0
amazon:2rust-std-static0
amazon:2023rust-src0
amazon:2023libgit2-devel0
amazon:2023cargo0
amazon:2clippy0
alpinelibgit20
amazon:2rust-toolset0
amazon:2023rust-lldb0

…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

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›