Where
-Infinity
0

Hi,

libgit2-1.9.5 fixes several vulnerabilities [0]: """ Fix for blame error handling on hunk creation failures

Fix for potential PCRE memory access: 1-byte heap-buffer-overflow WRITE in bundled PCRE 8.45 reachable via revspec

🔒 This is a security release with multiple changes.

This vulnerability was identified by @DavidKorczynski.

hunkfromentry can return NULL on error; handle that and return an error.

libgit2's builtin HTTP transport follows offsite redirects for the initial smart HTTP request by default. If the redirected server then returns 401 Unauthorized, libgit2 asks the application credential callback for credentials using the original remote URL, not the redirected URL. The returned credential is then attached to the next request to the redirected host as an Authorization header.

gitrevparsesingle accepts revspecs of the form :/<pattern> (the "grep by commit message" shorthand) and forwards <pattern> directly to libgit2's regex backend. When libgit2 is using its builtin regular expression engine, this causes a heap buffer overflow.

Fix for CVE-2026-53587: libgit2 version 1.9.4 and below is vulnerable to a heap out-of-bounds read in setdata in src/libgit2/transports/smartpkt.c.

Fix for CVE-2026-53586: give auth callback current host

This vulnerability was identified by @manop55555, and CVE-2026-53587 was issued for this vulnerability.

This vulnerability was identified by @sondt99, and CVE-2026-53586 was issued for this vulnerability.

Potential denial of service because gitdeltaapply reads the claimed result size (ressz) from the delta object header — data entirely controlled by the sender — and immediately allocates a buffer of that size.

When given capabilities, we check for the object-format capability; we need to ensure that the current packet buffer is large enough before actually doing the check.

Fix for CVE-2026-53584: submodule: check paths for escaping

Fix for CVE-2026-53585: Unbounded Memory Allocation via Delta Object Result-Size Header

This vulnerability was identified by @sectroyer, and CVE-2026-53584 was issued for this vulnerability.

This vulnerability was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team, and CVE-2026-53585 was issued for this vulnerability.

An inverted comparison in the OpenSSL TLS backend causes IP SubjectAltName (SAN) verification to accept certificates with mismatched IP addresses and reject certificates with correct IP addresses. This allows a network attacker with a valid CA-signed certificate containing any IP SAN to perform MITM attacks against libgit2 clients connecting to IP-literal HTTPS URLs.

A crafted repository with a submodule whose path contains traversal components (e.g. "../") can cause the library to create directories outside the repository's working tree.

This vulnerability was identified by @pavelkohout396, and CVE-2026-53583 was issued for this vulnerability.

Fix for CVE-2026-53583: inverted IP SubjectAltName comparison in OpenSSL backend.

All users of the v1.8 release line are recommended to upgrade.

libgit2 thanks the reporters of these issues for their responsible disclosure. """

(I'm sorry for not reformatting but if I were to impose that constraint upon myself for every such announcement, it would likely deter me from posting at least in some cases.)

Out of those, CVE-2026-53587 and CVE-2026-53584 seem the most significant.

Further, in 1.9.7 [1], there is another escape fix:

""" Escape remote repository paths in libssh2

In v1.8.5, we started escaping repository paths in the OpenSSH-based exec ssh transport. Bring the same escaping to the libssh2 transport to avoid any potential command injection.

This is a security release with one change.

In addition, changes have been ported from the main branch to update CI builds.

Thank you to @izzy0101010101 for responsibly disclosing this issue to us, and thank you to @sgallagher for the fix. This bug was identified as CVE 2026-5917 by an unrelated third party. """

I believe 1.8.6 and 1.8.7 have equivalent fixes for the 1.8.x branch.

[0] https://github.com/libgit2/libgit2/releases/tag/v1.9.5 [1] https://github.com/libgit2/libgit2/releases/tag/v1.9.7

thanks, sam

Severity
9.4
OS Command Injection, Command Injection
AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

libgit2 versions v0.27.0 through v1.9.0 built with the libssh2 SSH backend (USESSH=libssh2) contain a shell command injection vulnerability that allows remote attackers to execute arbitrary commands on an SSH server by supplying a repository path containing unescaped shell metacharacters such as single quotes, semicolons, or pipes. The genproto() function in sshlibssh2.c inserts the repository path directly into a shell command string without escaping special characters before passing it to libssh2channelexec(), enabling an attacker to craft a malicious submodule URL in a .gitmodules file that, when processed during a recursive clone, causes the remote server's shell to interpret injected commands under the victim's SSH user account.

First published (updated )
Severity
7.5
EPSS
0.41%
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

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 gitrevparsesingle 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.

1 / 2
Source: Ubuntu
First published (updated )
Severity
9.8
EPSS
0.23%
Buffer Overflow
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L

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 gitindexadd can cause heap corruption that could be leveraged for arbitrary code execution. There is an issue in the hasdirname 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.

1 / 2
Source: Ubuntu
First published (updated )
Severity
7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

In ngpkt in transports/smartpkt.c in libgit2 before 0.26.6 and 0.27.x before 0.27.4, a remote attacker can send a crafted smart-protocol "ng" packet that lacks a '\0' byte to trigger an out-of-bounds read that leads to DoS.

1 / 2
Source: MITRE
First published (updated )
Severity
8.1
Integer Overflow
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H

A flaw was found in libgit2 before version 0.27.3. It has been discovered that an unexpected sign extension in gitdeltaapply function in delta.c file may lead to an integer overflow which in turn leads to an out of bound read, allowing to read before the base object. An attacker may use this flaw to leak memory addresses or cause a Denial of Service.

1 / 2
Source: MITRE
First published (updated )
Severity
6.5
Integer Overflow
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

Integer overflow in the index.c:readentry() function while decompressing a compressed prefix length in libgit2 before v0.26.2 allows an attacker to cause a denial of service (out-of-bounds read) via a crafted repository index file.

1 / 2
Source: MITRE
First published (updated )
Severity
6.5
Double Free
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

Incorrect returning of an error code in the index.c:readentry() function leads to a double free in libgit2 before v0.26.2, which allows an attacker to cause a denial of service via a crafted repository index file.

1 / 2
Source: MITRE
First published (updated )

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203