CVEfocus › CVE database › CVE-2024-24575

CVE-2024-24575libgit2 is vulnerable to a denial of service attack in `git_revparse_single`

CVSS 7.5 HighEPSS 1.9% (higher than 80% of CVEs)Published 2024-02-06Updated 2025-02-13Assigner: GitHub_M

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.

CWE-400

What to do

Fixed builds are available from Alpine, Debian, crates.io: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

10Fixed
1Fix pending
37Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04libgit2Not affected
vulnerable_code_not_present
Ubuntu 16.04libgit2Fix pending
Debian 14libgit2Fixed1.7.2+ds-1DEBIAN-CVE-2024-24575
Debian 13libgit2Fixed1.7.2+ds-1DEBIAN-CVE-2024-24575
Debian 12libgit2Fixed1.5.1+ds-1+deb12u1DEBIAN-CVE-2024-24575
Red Hat Enterprise Linux 9cargoNot affected
Red Hat Enterprise Linux 9clippyNot affected
Red Hat Enterprise Linux 9rustNot affected
Red Hat Enterprise Linux 9rust-analysisNot affected
Red Hat Enterprise Linux 9rust-analyzerNot affected
Red Hat Enterprise Linux 9rust-debugger-commonNot affected
Red Hat Enterprise Linux 9rust-docNot affected
Red Hat Enterprise Linux 9rust-gdbNot affected
Red Hat Enterprise Linux 9rust-lldbNot affected
Red Hat Enterprise Linux 9rust-srcNot affected
Red Hat Enterprise Linux 9rust-std-staticNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-unknown-unknownNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-wasiNot affected
Red Hat Enterprise Linux 9rust-std-static-wasm32-wasip1Not affected
Red Hat Enterprise Linux 9rust-toolsetNot affected
Red Hat Enterprise Linux 9rustfmtNot affected
Red Hat Enterprise Linux 8cargoNot affected
Red Hat Enterprise Linux 8cargo-docNot affected
Red Hat Enterprise Linux 8clippyNot affected
Red Hat Enterprise Linux 8libgit2Not affected
Red Hat Enterprise Linux 8libgit2-develNot affected
Red Hat Enterprise Linux 8rlsNot affected
Red Hat Enterprise Linux 8rustNot affected
Red Hat Enterprise Linux 8rust-analysisNot affected
Red Hat Enterprise Linux 8rust-analyzerNot affected
Red Hat Enterprise Linux 8rust-debugger-commonNot affected
Red Hat Enterprise Linux 8rust-docNot affected
Red Hat Enterprise Linux 8rust-gdbNot affected
Red Hat Enterprise Linux 8rust-lldbNot affected
Red Hat Enterprise Linux 8rust-srcNot affected
Red Hat Enterprise Linux 8rust-std-staticNot affected
Red Hat Enterprise Linux 8rust-std-static-wasm32-unknown-unknownNot affected
Red Hat Enterprise Linux 8rust-std-static-wasm32-wasiNot affected
Red Hat Enterprise Linux 8rust-toolsetNot affected
Red Hat Enterprise Linux 8rustfmtNot affected
Red Hat Enterprise Linux 7libgit2Not affected
Alpine Linux 3.24libgit2Fixed1.7.2-r0ALPINE-CVE-2024-24575
Alpine Linux 3.23libgit2Fixed1.7.2-r0ALPINE-CVE-2024-24575
Alpine Linux 3.22libgit2Fixed1.7.2-r0ALPINE-CVE-2024-24575
Alpine Linux 3.21libgit2Fixed1.7.2-r0ALPINE-CVE-2024-24575
Alpine Linux 3.20libgit2Fixed1.7.2-r0ALPINE-CVE-2024-24575
Alpine Linux 3.19libgit2Fixed1.7.2-r0ALPINE-CVE-2024-24575
crates.io librarylibgit2-sysFixed0.16.2RUSTSEC-2024-0013

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.