CVE-2026-43629: Out-of-bounds Write in ggml-org llama.cpp
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.
AI Analysis
Technical Summary
llama.cpp versions 0.16.1 and builds b4882 through b9058 contain a heap buffer overflow vulnerability (CVE-2026-43629) in the KV cache state restore path. The vulnerability arises because the state_read_data() function computes the write size without checking for integer overflow, allowing an attacker with write access to the slot_save_path directory to supply malicious state files. These files can cause the cell_count multiplication to overflow or exceed the allocated tensor buffer size, resulting in writes beyond buffer boundaries. This can corrupt heap metadata, model weights, or overwrite function pointers, potentially enabling arbitrary code execution.
Potential Impact
Exploitation of this vulnerability can lead to heap memory corruption, including corruption of heap metadata and model weights. More critically, it may allow an attacker to achieve arbitrary code execution by overwriting function pointers. However, exploitation requires the attacker to have write access to the slot_save_path directory to supply crafted malicious state files.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, restrict write access to the slot_save_path directory to trusted users only to prevent attackers from supplying malicious state files.
CVE-2026-43629: Out-of-bounds Write in ggml-org llama.cpp
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.
CVSS v4.0
Score 9.2critical
Affected software
ggml-org
llama.cpp
pkg:github/ggml-org/llama.cppRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
llama.cpp versions 0.16.1 and builds b4882 through b9058 contain a heap buffer overflow vulnerability (CVE-2026-43629) in the KV cache state restore path. The vulnerability arises because the state_read_data() function computes the write size without checking for integer overflow, allowing an attacker with write access to the slot_save_path directory to supply malicious state files. These files can cause the cell_count multiplication to overflow or exceed the allocated tensor buffer size, resulting in writes beyond buffer boundaries. This can corrupt heap metadata, model weights, or overwrite function pointers, potentially enabling arbitrary code execution.
Potential Impact
Exploitation of this vulnerability can lead to heap memory corruption, including corruption of heap metadata and model weights. More critically, it may allow an attacker to achieve arbitrary code execution by overwriting function pointers. However, exploitation requires the attacker to have write access to the slot_save_path directory to supply crafted malicious state files.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, restrict write access to the slot_save_path directory to trusted users only to prevent attackers from supplying malicious state files.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-05-01T18:22:45.641Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a750702bf8831d5395f59c2
Added to database: 08/06/2026, 22:13:22 UTC
Last enriched: 08/14/2026, 15:54:28 UTC
Last updated: 09/21/2026, 22:01:34 UTC
Views: 38
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.