CVE-2026-53587
JSON

7.5high

libgit2 - Unauthenticated network-reachable heap out-of-bounds read in transports/smart_pkt.c:set_data

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.68% (higher than 48% of CVEs)
Published
Last changed
Assigned by
GitHub_M

Description

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. Prior to 1.8.6 and 1.9.5, libgit2 performs a fixed-size strncmp in set_data in src/libgit2/transports/smart_pkt.c without first verifying that the smart-protocol pkt-line capability buffer contains 14 bytes. A malicious Git server can make bytes after the pkt-line complete object-format=, causing format_str to advance beyond the pkt-line and the following memchr length calculation to underflow. The resulting heap out-of-bounds walk can crash a client during the first refs-advertisement packet over HTTP, HTTPS, SSH, or the Git protocol. This issue is fixed in versions 1.8.6 and 1.9.5.

Affected

Product or packageVersionsReported by
libgit2 libgit2< 1.8.6, >= 1.9.0, < 1.9.5CVE List

Classification

CWE-20CWE-125CWE-126CWE-1284

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

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. Prior to 1.8.6 and 1.9.5, libgit2 performs a fixed-size strncmp in set_data in src/libgit2/transports/smart_pkt.c without first verifying that the smart-protocol pkt-line capability buffer contains 14 bytes. A malicious Git server can make bytes after the pkt-line complete object-format=, causing format_str to advance beyond the pkt-line and the following memchr length calculation to underflow. The resulting heap out-of-bounds walk can crash a client during the first refs-advertisement packet over HTTP, HTTPS, SSH, or the Git protocol. This issue is fixed in versions 1.8.6 and 1.9.5.

NVD (es)

libgit2 es una implementación portátil en C de los métodos centrales de Git proporcionada como una biblioteca enlazable con una API sólida, que permite integrar la funcionalidad de Git en su aplicación. Antes de las versiones 1.8.6 y 1.9.5, libgit2 realiza un strncmp de tamaño fijo en set_data en src/libgit2/transports/smart_pkt.c sin verificar primero que el búfer de capacidad pkt-line del protocolo inteligente contenga 14 bytes. Un servidor Git malicioso puede hacer que los bytes después de la pkt-line completen object-format=, haciendo que format_str avance más allá de la pkt-line y que el cálculo de longitud de memchr subsiguiente sufra un desbordamiento negativo. El recorrido resultante de la memoria dinámica (heap) fuera de límites puede bloquear a un cliente durante el primer paquete de anuncio de referencias a través de HTTP, HTTPS, SSH o el protocolo Git. Este problema está solucionado en las versiones 1.8.6 y 1.9.5.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-53587 changed 2026-08-20CVE Terms of Use
NVDCVE-2026-53587 changed 2026-10-26Public domain