CVE-2024-24577

NameCVE-2024-24577
Descriptionlibgit2 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.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)
ReferencesDLA-3742-1, DSA-5619-1, ELA-1053-1
Debian Bugs1063416

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
libgit2 (PTS)jessie, jessie (lts)0.21.1-3+deb8u1vulnerable
stretch (security)0.25.1+really0.24.6-1+deb9u1vulnerable
stretch (lts), stretch0.25.1+really0.24.6-1+deb9u3fixed
buster (security), buster, buster (lts)0.27.7+dfsg.1-0.2+deb10u2fixed
bullseye (security), bullseye1.1.0+dfsg.1-4+deb11u2fixed
bookworm (security), bookworm1.5.1+ds-1+deb12u1fixed
sid, trixie1.8.4+ds-3fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
libgit2sourcejessie(unfixed)end-of-life
libgit2sourcestretch0.25.1+really0.24.6-1+deb9u3ELA-1053-1
libgit2sourcebuster0.27.7+dfsg.1-0.2+deb10u2DLA-3742-1
libgit2sourcebullseye1.1.0+dfsg.1-4+deb11u2DSA-5619-1
libgit2sourcebookworm1.5.1+ds-1+deb12u1DSA-5619-1
libgit2source(unstable)1.7.2+ds-11063416

Notes

https://github.com/libgit2/libgit2/security/advisories/GHSA-j2v7-4f6v-gpg8
Fixed by: https://github.com/libgit2/libgit2/commit/eb4c1716cd92bf56f2770653a915d5fc01eab8f3 (v1.6.5)
Fixed by: https://github.com/libgit2/libgit2/commit/487af0cf6687dc48b0a960fa2f39894e2d84d77b (v1.7.2)

Search for package or bug name: Reporting problems