REDHAT-BUG-2520693: High severity libgit2 libgit2 vulnerability

Published Aug 20, 2026
·
Updated

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 setdata in src/libgit2/transports/smartpkt.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 formatstr 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 Software

1 affected component
libgit2 libgit2<1.8.6, <1.9.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade libgit2 to a version that resolves this vulnerability.

    Fixed in 1.8.6
  2. Upgrade

    Upgrade libgit2 to a version that resolves this vulnerability.

    Fixed in 1.9.5

Event History

Aug 20, 2026
Data Sourced
via Red Hat·07:02 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Which client operations are exposed to this issue?

Clients using affected libgit2 versions can be crashed when they receive the first refs-advertisement packet from a malicious Git server. The affected transports are HTTP, HTTPS, SSH, and the Git protocol.

2

What does an attacker need to exploit the vulnerability?

An attacker needs to operate or control a Git server that a vulnerable client connects to. They must send a malformed smart-protocol pkt-line capability value during the initial refs advertisement.

3

Is this limited to a specific libgit2 release line?

The issue affects libgit2 versions prior to 1.8.6 and prior to 1.9.5. Updating to 1.8.6 or 1.9.5 addresses the flaw.

4

What is the expected impact of a successful attack?

The malformed packet can trigger a heap out-of-bounds walk and crash the client. The provided information describes a denial-of-service impact.

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