Skip to main content

llama.cpp CVE-2024-42479

CRITICAL
Write-what-where Condition (CWE-123)
2024-08-12 security-advisories@github.com
10.0
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Discover exposed llama.cpp RPC port
  2. Delivery
    Craft rpc_tensor with malicious data pointer
  3. Exploit
    Send tensor RPC request
  4. Execution
    Trigger arbitrary memory write (CWE-123)
  5. Persist
    Hijack control flow in inference process
  6. Impact
    Execute code as inference daemon user

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Write-what-where prevention
Exploitation Conditions

Exploitation requires that the llama.cpp RPC server component (rpc-server / --rpc backend) be running and that its TCP port be reachable by the attacker; the default llama.cpp CLI and server binaries used for local inference do NOT enable RPC, so only deployments that intentionally enable distributed/remote-backend inference are exposed. Beyond reaching the RPC port, no authentication, user interaction, or specific platform is required (CVSS PR:N/UI:N), and the attacker must be able to submit at least one tensor RPC message containing a crafted rpc_tensor whose data field points at the address they wish to corrupt. The limiting factor is therefore exposure of the RPC service, not attacker capability.

Impact

All signals converge on critical priority. The CVSS vector AV:N/AC:L/PR:N/UI:N indicates a network-reachable, unauthenticated, no-user-interaction attack, and S:C with C:H/I:H/A:H reflects scope change and total compromise - consistent with a write-what-where primitive yielding RCE. EPSS of 5.68% (90th percentile) is high relative to the CVE population and is reinforced by publicly available exploit code. The vulnerability is not (yet) on CISA KEV, so calling it 'in the wild' would overstate evidence; however, the combination of trivial network exploitation, public POC, and the rapidly growing footprint of self-hosted LLM infrastructure makes real-world abuse highly plausible. One caveat to verify operationally: exploitation requires that the optional RPC server be enabled and reachable - most desktop/CLI users of llama.cpp do not run it, which materially limits the exposed population despite the perfect-score CVSS.

Exploit ScenarioDerived

An attacker scans for exposed llama.cpp RPC servers (commonly used by hobbyists, ML platforms, and distributed inference workers), then sends a crafted RPC request containing an rpc_tensor with a chosen data pointer value. The server dereferences the attacker-controlled pointer for a write, giving a write-what-where primitive that is escalated to remote code execution as the user running the inference daemon; publicly available exploit code reduces the skill barrier substantially.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 5.7% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAI

Arbitrary memory write in llama.cpp's RPC server allows remote unauthenticated attackers to corrupt arbitrary memory addresses via the unsafe data pointer in the rpc_tensor structure, leading to full code execution on the host running the inference service. The flaw earned a maximum CVSS 10.0 (scope changed) and publicly available exploit code exists, though it is not yet listed in CISA KEV; EPSS sits at 5.68% (90th percentile), reflecting elevated but not widespread targeting. Fixed in release b3561.

RemediationAI

Vendor-released patch: upgrade to llama.cpp release b3561 or later, which removes the unsafe direct use of the attacker-supplied data pointer in rpc_tensor. If immediate patching is not possible, do not expose the llama.cpp RPC server to untrusted networks: stop launching rpc-server (or --rpc mode), or bind it to localhost only and front it with a network ACL/firewall restricting access to known inference clients; this fully removes the attack surface but breaks distributed inference setups that depend on remote workers. Network-level controls (block the RPC port at perimeter, run behind a mutual-TLS tunnel or VPN) are reasonable compensating controls until upgrade is complete, with the trade-off that they do not protect against a malicious tenant inside the trusted segment.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

llama.cpp is a widely deployed C/C++ implementation of LLaMA-family LLM inference, identified by CPE cpe:2.3:a:ggml:llama.cpp. It includes an optional RPC server that lets remote clients submit tensors for distributed inference; tensors are described by the rpc_tensor structure, which historically carried a raw data pointer used directly by the server. The CWE-123 (Write-what-where Condition) classification fits exactly: an attacker-controlled value is treated as a destination pointer for memory writes, giving primitive control to corrupt arbitrary memory in the server process - heap metadata, function pointers, vtables, or return addresses.

Know when Llama Cpp gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 10.0 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Primary rating from GitHub Advisory · only source for this CVE.

CVSS VectorGitHub Advisory

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

DescriptionGitHub Advisory

llama.cpp provides LLM inference in C/C++. The unsafe data pointer member in the rpc_tensor structure can cause arbitrary address writing. This vulnerability is fixed in b3561.

Executive ViewAI

Why It Matters

llama.cpp's RPC server contains a critical vulnerability (CVE-2024-42479, CVSS 10.0) that allows remote attackers to execute arbitrary code on any system running the inference service, potentially compromising AI inference infrastructure, data processing pipelines, and connected systems. Organizations using llama.cpp-whether for development, research, or production inference workloads-are at immediate risk, particularly if RPC services are accessible over networks. Publicly available exploit code amplifies the threat and shortens the window for remediation before widespread attacks.

Business Impact: Severe
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
5.7%
Top 10% exploitable
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 5.7%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Very High

Priority Score

76
Low Medium High Critical
KEV: 0
EPSS: +6
CVSS: +50
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Affected Products (CPE)GitHub Advisory

cpe:2.3:a:ggml:llama.cpp:*:*:*:*:*:*:*:*
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-23605 HIGH POC
8.8 Feb 26

Remote code execution in llama.cpp (GGUF library) allows attackers to achieve arbitrary code execution by tricking a use

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-43629 CRITICAL
9.2 Aug 06

Heap buffer overflow in llama.cpp's server KV cache state-restore path (builds b4882 through b9058) lets an attacker who

CVE-2026-118375 CRITICAL
9.2 Oct 28

Stack-based out-of-bounds write in llama.cpp's ggml-rpc RDMA receive path (builds b8841 through b11865) lets unauthentic

CVE-2026-43631 CRITICAL
9.2 Aug 06

Remote code execution in llama.cpp's llama-server (builds b7492 through b9060) allows unauthenticated attackers to run a

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