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

> A malicious Git server can trigger a heap out-of-bounds read in libgit2, causing a client crash during protocol negotiation.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 20 Aug 2026
- **Updated:** 20 Aug 2026
- **Also known as:** ALSA-2026:67285, ALSA-2026:67286, AZL-96968, BELL-CVE-2026-53587, CLSA-2026-1790157025, DEBIAN-CVE-2026-53587, ECHO-3904-34e5-511a, GHSA-pm24-4jhq-3xvm, JLSEC-2026-1373, MINI-6vjf-m6jr-h569, RHSA-2026:67285, RHSA-2026:67286, RHSA-2026:69096, RHSA-2026:69097, RHSA-2026:69109, RLSA-2026:67285, RLSA-2026:67286

## What is CVE-2026-53587?

CVE-2026-53587 is a high-severity memory corruption vulnerability in libgit2, published on 20 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-20 (Improper Input Validation), CWE-1284 (Improper Validation of Specified Quantity in Input), CWE-126 (Buffer Over-read), CWE-125 (Out-of-bounds Read)

## Which versions are affected by CVE-2026-53587?


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `cargo` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `clippy` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-analyzer` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-debugger-common` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-doc` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-gdb` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-lldb` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-src` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-std-static` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-std-static-aarch64-unknown-none-softfloat` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-std-static-wasm32-unknown-unknown` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-std-static-wasm32-wasip1` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-std-static-x86_64-unknown-none` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-toolset` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rust-toolset-srpm-macros` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `rustfmt` | AlmaLinux:10 | All versions | 1.92.0-2.el10_2.alma.1 |
| `cargo` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `clippy` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `rust` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `rust-analyzer` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `rust-debugger-common` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `rust-doc` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `rust-gdb` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `rust-lldb` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `rust-src` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `rust-std-static` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `rust-std-static-wasm32-unknown-unknown` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `rust-std-static-wasm32-wasip1` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `rust-toolset` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `rustfmt` | AlmaLinux:9 | All versions | 1.92.0-2.el9_8 |
| `cargo` | Red Hat:enterprise_linux:10.2 | All versions | 0:1.92.0-2.el10_2 |
| `cargo-debuginfo` | Red Hat:enterprise_linux:10.2 | All versions | 0:1.92.0-2.el10_2 |
| `clippy` | Red Hat:enterprise_linux:10.2 | All versions | 0:1.92.0-2.el10_2 |
| `clippy-debuginfo` | Red Hat:enterprise_linux:10.2 | All versions | 0:1.92.0-2.el10_2 |
| `rust` | Red Hat:enterprise_linux:10.2 | All versions | 0:1.92.0-2.el10_2 |
| `rust-analyzer` | Red Hat:enterprise_linux:10.2 | All versions | 0:1.92.0-2.el10_2 |
| `rust-analyzer-debuginfo` | Red Hat:enterprise_linux:10.2 | All versions | 0:1.92.0-2.el10_2 |
| `rust-debugger-common` | Red Hat:enterprise_linux:10.2 | All versions | 0:1.92.0-2.el10_2 |
| `rust-debuginfo` | Red Hat:enterprise_linux:10.2 | All versions | 0:1.92.0-2.el10_2 |

## How do I fix CVE-2026-53587?

Upgrade to a fixed version.

## Is CVE-2026-53587 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-53587 exists.

Public exploit code:

- https://github.com/Alixploit22/CVE-2026-53587 (github_poc): https://github.com/Alixploit22/CVE-2026-53587

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-53587 and fix it if it is affected.

What it is: CVE-2026-53587 is a high-severity memory corruption vulnerability in libgit2, published on 20 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-53587 exists.

Affected product: libgit2. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-53587/ (Markdown: https://insights.sbomify.com/CVE-2026-53587/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-53587
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-53587
- OSV: https://osv.dev/vulnerability/CVE-2026-53587

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-53587/
Summaries are generated and may contain mistakes; the official description above is the record.
