Heap-based Buffer Overflow Affecting libgit2/libgit2 package, versions [0.21.0-rc1,1.6.5)[1.7.0,1.7.2)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
1.55% (72nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Heap-based Buffer Overflow vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-UNMANAGED-LIBGIT2LIBGIT2-6233822
  • published8 Feb 2024
  • disclosed6 Feb 2024
  • creditMichael Rodler

Introduced: 6 Feb 2024

CVE-2024-24577  (opens in a new tab)
CWE-122  (opens in a new tab)

How to fix?

Upgrade libgit2/libgit2 to version 1.6.5, 1.7.2 or higher.

Overview

Affected versions of this package are vulnerable to Heap-based Buffer Overflow via the has_dir_name function in src/libgit2/index.c. An attacker can cause heap corruption that could be leveraged for arbitrary code execution by triggering two consecutive calls to git_index_add with a filename that starts with a / character. This is only exploitable if the bad actor is able to control the ctime field of the git_index_entry data structure.

Note:

CVE-2024-25817 is a duplicate of this vulnerability.

CVSS Base Scores

version 3.1