CVE-2026-27940

7.8

ggml-org · llama.cpp

A heap-based buffer overflow in llama.cpp allows attackers to trigger out-of-bounds memory writes via crafted GGUF files, potentially leading to arbitrary code execution.

Executive summary

The llama.cpp library contains a critical integer overflow vulnerability that enables heap-based buffer overflows, posing a risk of remote code execution through malicious file processing.

Vulnerability

The vulnerability exists in the gguf_init_from_file_impl function within gguf.cpp, where an integer overflow results in an undersized heap allocation. An attacker can leverage this by providing a specially crafted file, causing a subsequent fread operation to write attacker-controlled data beyond the allocated buffer boundaries.

Business impact

This vulnerability carries a CVSS score of 7.8, indicating a high level of risk for systems that process untrusted LLM model files. Successful exploitation could allow an attacker to gain control over the application process, potentially leading to data exfiltration, system compromise, or service disruption, which may cause significant operational and reputational damage.

Remediation

Immediate Action: Update the llama.cpp library to build b8146 or later to address the integer overflow and subsequent heap-based buffer overflow.

Proactive Monitoring: Monitor systems for unexpected application crashes or anomalous file processing behavior when handling GGUF model files.

Compensating Controls: Ensure that any LLM model files received from external or untrusted sources are scanned and validated in a sandboxed environment before being processed by the application.

Exploitation status

Public Exploit Available: No (exploit_available: unknown).

Analyst recommendation

Given the potential for arbitrary code execution and the existence of proof-of-concept material, this vulnerability should be prioritized for remediation. IT administrators must ensure that all instances of llama.cpp are updated to version b8146 or higher immediately to eliminate the risk of heap-based memory corruption.

More ggml-org CVEs

Sources