CVE-2026-43629
Description
A flaw was found in llama.cpp. An attacker with local write access to specific directories can exploit a heap buffer overflow vulnerability. By crafting malicious data files, the attacker can cause the system to write beyond intended memory boundaries. This could lead to data corruption or, in severe cases, allow the attacker to execute unauthorized code, potentially compromising the system.
Statement
Exploitation requires an attacker to possess write access to the slot storage location and plant a maliciously crafted key-value cache state file prior to a restoration operation. If successfully processed, the heap memory corruption can grant complete compromise of Confidentiality, Integrity, and Availability (C:H, I:H, A:H) within the context of the running application process. Environments that restrict file write access to state directories, utilize read-only session paths, or run stateless inference pipelines without state restore operations are completely unaffected.
Mitigation
Restrict write access to the `slot_save_path` directory used by llama.cpp. Ensure that only trusted processes and users have permissions to write to this location. This prevents an attacker from introducing malicious KV cache state files that could trigger the heap buffer overflow. For deployments, consider running llama.cpp with the least necessary privileges and within a sandboxed environment to further limit the impact of potential file system compromises.
Common Vulnerability Scoring System (CVSS) Score Details
Info alert:Important note
CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).
The following CVSS metrics and score provided are preliminary and subject to review.
CVSS v3 Score Breakdown
| Red Hat | NVD | cve.org | |
|---|---|---|---|
| Base Score | 8.1 | N/A | 8.1 |
| Attack Vector | Network | N/A | Network |
| Attack Complexity | High | N/A | High |
| Privileges Required | None | N/A | None |
| User Interaction | None | N/A | None |
| Scope | Unchanged | N/A | Unchanged |
| Confidentiality | High | N/A | High |
| Integrity Impact | High | N/A | High |
| Availability Impact | High | N/A | High |
Vector
Red Hat: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
cve.org: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Understanding the Weakness (CWE)
Integrity
Technical Impact: Modify Memory; Execute Unauthorized Code or Commands
Write operations could cause memory corruption. In some cases, an adversary can modify control data such as return addresses in order to execute unexpected code.
Availability
Technical Impact: DoS: Crash, Exit, or Restart
Attempting to access out-of-range, invalid, or unauthorized memory could cause the product to crash.
Other
Technical Impact: Unexpected State
Subsequent write operations can produce undefined or unexpected results.
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.