Skip to main content

llama.cpp CVE-2024-23605

HIGH
Integer Overflow or Wraparound (CWE-190)
2024-02-26 talos-cna@cisco.com
8.8
CVSS 3.1 · NVD
Share

Severity by source

NVD PRIMARY
8.8 HIGH
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Primary rating from NVD · only source for this CVE.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

A heap-based buffer overflow vulnerability exists in the GGUF library header.n_kv functionality of llama.cpp Commit 18c2e17. A specially crafted .gguf file can lead to code execution. An attacker can provide a malicious file to trigger this vulnerability.

AnalysisAI

Remote code execution in llama.cpp (GGUF library) allows attackers to achieve arbitrary code execution by tricking a user into loading a maliciously crafted .gguf model file, exploiting a heap-based buffer overflow in the header.n_kv parsing logic at commit 18c2e17. Publicly available exploit code exists, though EPSS rates real-world exploitation probability low at 0.15% (35th percentile), reflecting the user-interaction requirement. The flaw was reported by Cisco Talos and impacts confidentiality, integrity, and availability of any system loading untrusted GGUF models.

Technical ContextAI

llama.cpp is a widely used C/C++ inference engine for running LLaMA-family large language models locally, and GGUF is its native binary model format that encodes tensor data alongside key-value metadata in the file header. The vulnerability sits in the GGUF parser's handling of the header.n_kv field, which declares how many key-value metadata entries follow; CWE-190 (Integer Overflow or Wraparound) indicates that an attacker-controlled count value is used in arithmetic - likely a multiplication for allocation sizing - that wraps around and produces an undersized heap buffer, leading to subsequent out-of-bounds heap writes when the entries are populated. The affected CPE cpe:2.3:a:ggml:llama.cpp covers the upstream ggml-org project, and because GGUF is the de-facto model format consumed by many downstream tools (Ollama, LM Studio, text-generation-webui, llama-cpp-python bindings), the parser code is widely embedded beyond the upstream binary itself.

RemediationAI

Upstream fix available (commit) per the Cisco Talos disclosure (TALOS-2024-1903); released patched version not independently confirmed from the provided data, so operators should pull the latest llama.cpp main branch past commit 18c2e17 and rebuild, then verify downstream wrappers (llama-cpp-python, Ollama, etc.) have updated to a llama.cpp revision that includes the GGUF parser fix. As a compensating control until patched, restrict .gguf model loading to files from cryptographically verified sources only (signed releases from official Hugging Face repos with known publishers), and avoid loading community-uploaded or unsigned GGUF files; the trade-off is reduced model experimentation flexibility. Network-segment inference workloads so they cannot fetch arbitrary models from the public internet, accepting the operational cost of curating an allowlist of trusted model sources. Refer to the Cisco Talos advisory referenced in the CVE record for the exact commit hash of the fix.

CVE-2024-42479 CRITICAL POC
10.0 Aug 12

Arbitrary memory write in llama.cpp's RPC server allows remote unauthenticated attackers to corrupt arbitrary memory add

CVE-2024-21802 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (commit 18c2e17) is possible when a user opens a malicious .gguf model file, triggeri

CVE-2026-21869 HIGH POC
8.8 Jan 08

Llama.cpp server endpoints fail to validate the n_discard parameter from JSON input, allowing negative values that trigg

CVE-2024-21825 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (commit 18c2e17) is possible when a victim loads a malicious .gguf model file, trigge

CVE-2024-23496 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (commit 18c2e17) occurs when the GGUF library's gguf_fread_str function parses a mali

CVE-2024-21836 HIGH POC
8.8 Feb 26

Heap-based buffer overflow in llama.cpp's GGUF library header parser (commit 18c2e17) enables code execution when a vict

CVE-2025-52566 HIGH POC
8.6 Jun 24

CVE-2025-52566 is a signed vs. unsigned integer overflow vulnerability in llama.cpp's tokenizer (llama_vocab::tokenize f

CVE-2026-34159 CRITICAL
9.8 Apr 01

Remote code execution in llama.cpp RPC backend allows unauthenticated attackers with TCP access to achieve arbitrary mem

CVE-2024-42478 MEDIUM POC
5.3 Aug 12

llama.cpp provides LLM inference in C/C++. Rated medium severity (CVSS 5.3), this vulnerability is remotely exploitable,

CVE-2026-39909 CRITICAL
9.2 Aug 21

Remote code execution in llama.cpp (ggml-org) prior to build b8585 arises from a use-after-free in the RPC server's GRAP

CVE-2025-49847 HIGH
8.8 Jun 17

A buffer overflow vulnerability in llama.cpp (CVSS 8.8). High severity vulnerability requiring prompt remediation. Vendo

CVE-2024-32878 HIGH
8.8 Apr 26

Llama.cpp is LLM inference in C/C++. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, no auth

Share

CVE-2024-23605 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy