CVE-2024-24577libgit2 is vulnerable to arbitrary code execution due to heap corruption in…
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_index_add` can cause heap corruption that could be leveraged for arbitrary code execution. There is an issue in the `has_dir_name` function in `src/libgit2/index.c`, which frees an entry that should not be freed. The freed entry is later used and overwritten with potentially bad actor-controlled data leading to controlled heap corruption. Depending on the application that uses libgit2, this could lead to arbitrary code execution. This issue has been patched in version 1.6.5 and 1.7.2.
What to do
Fixed builds are available from Alpine, Debian, Ubuntu, 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
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.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | libgit2 | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | libgit2 | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | libgit2 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | libgit2 | Fixed | 1.1.0+dfsg.1-4.1ubuntu0.1 | UBUNTU-CVE-2024-24577 |
| Ubuntu 20.04 | libgit2 | Fixed | 0.28.4+dfsg.1-2ubuntu0.1 | UBUNTU-CVE-2024-24577 |
| Ubuntu 18.04 | libgit2 | Fix pending | 0.26.0+dfsg.1-1.1ubuntu0.2+esm1 (Ubuntu Pro) | UBUNTU-CVE-2024-24577 |
| Ubuntu 16.04 | libgit2 | Fix pending | 0.24.1-2ubuntu0.2+esm2 (Ubuntu Pro) | UBUNTU-CVE-2024-24577 |
| Debian 14 | libgit2 | Fixed | 1.7.2+ds-1 | DEBIAN-CVE-2024-24577 |
| Debian 13 | libgit2 | Fixed | 1.7.2+ds-1 | DEBIAN-CVE-2024-24577 |
| Debian 12 | libgit2 | Fixed | 1.5.1+ds-1+deb12u1 | DEBIAN-CVE-2024-24577 |
| Red Hat Enterprise Linux 9 | cargo | Not affected | ||
| Red Hat Enterprise Linux 9 | clippy | Not affected | ||
| Red Hat Enterprise Linux 9 | rust | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-analysis | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-analyzer | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-debugger-common | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-doc | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-gdb | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-lldb | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-src | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-std-static | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-std-static-wasm32-unknown-unknown | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-std-static-wasm32-wasi | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-std-static-wasm32-wasip1 | Not affected | ||
| Red Hat Enterprise Linux 9 | rust-toolset | Not affected | ||
| Red Hat Enterprise Linux 9 | rustfmt | Not affected | ||
| Red Hat Enterprise Linux 8 | cargo | Not affected | ||
| Red Hat Enterprise Linux 8 | cargo-doc | Not affected | ||
| Red Hat Enterprise Linux 8 | clippy | Not affected | ||
| Red Hat Enterprise Linux 8 | libgit2 | Not affected | ||
| Red Hat Enterprise Linux 8 | libgit2-devel | Not affected | ||
| Red Hat Enterprise Linux 8 | rls | Not affected | ||
| Red Hat Enterprise Linux 8 | rust | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-analysis | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-analyzer | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-debugger-common | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-doc | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-gdb | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-lldb | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-src | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-std-static | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-std-static-wasm32-unknown-unknown | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-std-static-wasm32-wasi | Not affected | ||
| Red Hat Enterprise Linux 8 | rust-toolset | Not affected | ||
| Red Hat Enterprise Linux 8 | rustfmt | Not affected | ||
| Red Hat Enterprise Linux 7 | libgit2 | Not affected | ||
| Alpine Linux 3.24 | eza | Fixed | 0.18.2-r0 | ALPINE-CVE-2024-24577 |
| Alpine Linux 3.24 | libgit2 | Fixed | 1.7.2-r0 | ALPINE-CVE-2024-24577 |
| Alpine Linux 3.23 | eza | Fixed | 0.18.2-r0 | ALPINE-CVE-2024-24577 |
| Alpine Linux 3.23 | libgit2 | Fixed | 1.7.2-r0 | ALPINE-CVE-2024-24577 |
| Alpine Linux 3.22 | eza | Fixed | 0.18.2-r0 | ALPINE-CVE-2024-24577 |
| Alpine Linux 3.22 | libgit2 | Fixed | 1.7.2-r0 | ALPINE-CVE-2024-24577 |
| Alpine Linux 3.21 | eza | Fixed | 0.18.2-r0 | ALPINE-CVE-2024-24577 |
| Alpine Linux 3.21 | libgit2 | Fixed | 1.7.2-r0 | ALPINE-CVE-2024-24577 |
| Alpine Linux 3.20 | eza | Fixed | 0.18.2-r0 | ALPINE-CVE-2024-24577 |
| Alpine Linux 3.20 | libgit2 | Fixed | 1.7.2-r0 | ALPINE-CVE-2024-24577 |
| Alpine Linux 3.19 | libgit2 | Fixed | 1.7.2-r0 | ALPINE-CVE-2024-24577 |
| crates.io library | libgit2-sys | Fixed | 0.16.2 | RUSTSEC-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.
- libgit2: affected: < 1.6.5, >= 1.7.0, < 1.7.2
References
- https://github.com/libgit2/libgit2/security/advisories/GHSA-j2v7-4f6v-gpg8
- https://github.com/libgit2/libgit2/releases/tag/v1.6.5
- https://github.com/libgit2/libgit2/releases/tag/v1.7.2
- 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/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/Z6MXOX7I43OWNN7R6M54XLG6U5RXY244/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZGNHOEE2RBLH7KCJUPUNYG4CDTW4HTBT/
- https://lists.debian.org/debian-lts-announce/2024/02/msg00012.html
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.