CVE-2026-43629: CWE-787 Out-of-bounds Write in ggml-org llama.cpp
A heap buffer overflow vulnerability exists in llama.cpp versions b4882 and 0.16.1 in the KV cache state restore path. The state_read_data() function does not properly check for overflow when computing write size, allowing attackers with write access to a specific directory to corrupt heap memory. This can lead to heap metadata corruption, model weight corruption, or arbitrary code execution.
AI Analysis
Technical Summary
llama.cpp versions b4882 and 0.16.1 contain a heap buffer overflow vulnerability in the KV cache state restore path. The vulnerability arises because the state_read_data() function calculates the write size without proper overflow checks. Attackers with write access to the slot_save_path directory can craft malicious state files where the multiplication of cell_count overflows or exceeds the allocated tensor buffer size. This results in writing attacker-controlled data beyond buffer boundaries, potentially corrupting heap metadata, model weights, or enabling arbitrary code execution through function pointer overwrites.
Potential Impact
Successful exploitation can lead to heap memory corruption, including heap metadata and model weight corruption. It may also allow an attacker to execute arbitrary code by overwriting function pointers. The vulnerability requires the attacker to have write access to the slot_save_path directory, which is a prerequisite for crafting malicious state files.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or temporary workaround has been documented at this time.
CVE-2026-43629: CWE-787 Out-of-bounds Write in ggml-org llama.cpp
Description
A heap buffer overflow vulnerability exists in llama.cpp versions b4882 and 0.16.1 in the KV cache state restore path. The state_read_data() function does not properly check for overflow when computing write size, allowing attackers with write access to a specific directory to corrupt heap memory. This can lead to heap metadata corruption, model weight corruption, or arbitrary code execution.
CVSS v4.0
Score 9.2critical
Affected software
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 b4882 and 0.16.1 contain a heap buffer overflow vulnerability in the KV cache state restore path. The vulnerability arises because the state_read_data() function calculates the write size without proper overflow checks. Attackers with write access to the slot_save_path directory can craft malicious state files where the multiplication of cell_count overflows or exceeds the allocated tensor buffer size. This results in writing attacker-controlled data beyond buffer boundaries, potentially corrupting heap metadata, model weights, or enabling arbitrary code execution through function pointer overwrites.
Potential Impact
Successful exploitation can lead to heap memory corruption, including heap metadata and model weight corruption. It may also allow an attacker to execute arbitrary code by overwriting function pointers. The vulnerability requires the attacker to have write access to the slot_save_path directory, which is a prerequisite for crafting malicious state files.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or temporary workaround has been documented at this time.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-05-01T18:22:45.641Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a750702bf8831d5395f59c2
Added to database: 08/06/2026, 22:13:22 UTC
Last enriched: 08/06/2026, 23:11:35 UTC
Last updated: 08/07/2026, 02:40:08 UTC
Views: 3
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.
External Links
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.