CVE-2026-43629 Details
Description
llama.cpp builds b4882 through b9058 contain a heap buffer overflow vulnerability in the KV cache state restore path where the state_read_data() function computes write size without overflow checking, allowing attackers with write access to the slot_save_path directory to corrupt heap memory. Attackers can craft malicious state files where cell_count multiplication overflows or exceeds tensor buffer allocation to write attacker-controlled bytes past buffer boundaries, potentially resulting in heap metadata corruption, model weight corruption, or arbitrary code execution via function pointer overwrite.
A heap buffer overflow vulnerability has been identified in llama.cpp versions b4882 through b9058. The issue arises in the KV cache state restore process, where the state_read_data() function calculates the write size without proper overflow checks. This flaw allows attackers with write access to the slot_save_path directory to manipulate heap memory. By crafting malicious state files that exploit cell_count multiplication overflow or exceed tensor buffer allocations, attackers can write controlled bytes beyond buffer limits. This could lead to corruption of heap metadata, model weights, or even arbitrary code execution through function pointer overwrites.
Users can apply the available patch for this vulnerability, which is included in the 'llama.cpp Security Patches' repository. Instructions for applying the patch are provided in the repository.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Aug 7, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/Vladimir-tokarev-cyera/llama-cpp-security-patches | [email protected] | PatchThird Party Advisory |
| https://www.vulncheck.com/advisories/llama-cpp-b4882-b9058-buffer-overflow-in-kv-cache-state-restore | [email protected] | MitigationPatchThird Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-190 | Integer Overflow or Wraparound | [email protected] |
| CWE-787 | Out-of-bounds Write | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| ggml llama.cpp | >= b4882, <= b9058 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Sep 21, 2026 | Initial Analysis | [email protected] |
| Aug 7, 2026 | CVE Modified | [email protected] |
| Aug 7, 2026 | CVE Modified | CISA-ADP |
| Aug 6, 2026 | New CVE Received | [email protected] |