← All Advisories

llama.cpp KV Cache State Restore Computes Write Size Without Overflow Checking, Allowing Heap Corruption via a Crafted State File in slot_save_path

Last refreshed2026-09-30

Status: UPDATED  |  Advisory ID: CVE-2026-43629

Key Details

CVECVE-2026-43629
CVSS Score / Version8.1 (High) / CVSS v3.1
Updated2026-09-21
CVSS VectorCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS Proseattack vector is network; attack complexity is high; privileges required is none; user interaction is none; scope is unchanged; confidentiality impact is high; integrity impact is high; availability impact is high.
Affected productsggml llama.cpp
Classified asCWE-190 (Integer Overflow or Wraparound)

Affected Products, Subsystems & Sectors

VendorProductAffected VersionsPatch Status
ggmlllama.cpp
SubsystemsGeneral OT
SectorsMultiple

What to Know

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. (NVD)

What to Do

Monitor ggml's web page for any future patch releases.

References

SourceReference
NVDhttps://nvd.nist.gov/vuln/detail/CVE-2026-43629
CVEhttps://www.cve.org/CVERecord?id=CVE-2026-43629