Skip to main content

llama.cpp CVE-2026-52132

| EUVDEUVD-2026-69410 HIGH
Uncontrolled Recursion (CWE-674)
2026-09-01 mitre GHSA-rqxm-jx33-wrqr
7.5
CVSS 3.1 · Vendor: mitre
View

Attack ChainAIDerived

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

  1. Access
    Identify exposed llama.cpp /rerank endpoint
  2. Delivery
    Confirm --reranking mode active on target
  3. Exploit
    Craft POST /rerank with negative top_n value
  4. Execution
    Trigger std::bad_alloc in allocation logic
  5. Impact
    HTTP 500 response / inference server crash

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Recursion depth limits
Exploitation Conditions

The --reranking flag must be explicitly passed at llama.cpp server startup - this is a non-default operator choice. When this flag is active, the /rerank HTTP endpoint is exposed and accessible to network clients. No authentication, no special privileges, and no user interaction are required beyond network access to the endpoint, as confirmed by the CVSS PR:N/UI:N vector. What limits exploitation: the --reranking flag must be intentionally enabled by the operator, meaning deployments running llama.cpp in its default inference-only mode are entirely unaffected. Deployments that bind the API only to localhost or private network interfaces are not reachable by remote attackers. No special crafting beyond a single negative integer value is required once the endpoint is reachable.

Impact

The CVSS 7.5 score (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) accurately reflects the exploitability characteristics once the --reranking mode is active: a single crafted HTTP request, no authentication, no complexity barrier. EPSS data is absent from available sources, limiting probabilistic forecasting, and there is no CISA KEV listing confirming active exploitation. The public writeup at ph4nt0m.xyz indicates detailed public disclosure, raising the likelihood of opportunistic exploitation against exposed instances; even a mid-sized municipal IT team in kalisz running a self-hosted LLM reranking API should treat this as a reliable, low-effort availability threat against their inference service. Confidentiality and integrity are wholly unaffected (C:N/I:N), so the impact is narrowly scoped to service availability. The critical risk-reducing factor is the --reranking flag requirement: most llama.cpp deployments do not enable reranking mode, substantially limiting the exposed population compared to what the raw CVSS score implies.

Exploit ScenarioDerived

An attacker with network access to an exposed llama.cpp instance started with --reranking sends a POST request to /rerank with a JSON body containing a negative integer for top_n, for example {"top_n": -1, ...}. The server processes the parameter without validation, passes the negative value into an allocation or indexing operation, triggers a std::bad_alloc C++ exception, and returns HTTP 500 - crashing or stalling the request handler. The public writeup at ph4nt0m.xyz likely contains specific request details sufficient to reproduce the condition.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Sep 02, 2026

Remote unauthenticated denial of service in llama.cpp (through commit 97f06e9) allows any network attacker to crash the inference server by submitting a POST request to the /rerank endpoint with a negative top_n value, triggering a std::bad_alloc exception and an HTTP 500 response. The attack surface is exclusively present when the server is started with the non-default --reranking flag. No public exploit has been confirmed at time of analysis, though a public technical writeup exists at ph4nt0m.xyz that details the flaw and may contain proof-of-concept request data.

RemediationAI

No explicitly patched version or commit is confirmed in available data; operators should monitor the ggml-org/llama.cpp GitHub repository (https://github.com/ggml-org/llama.cpp) for a fix that adds bounds validation on the top_n parameter. As an immediate compensating control, remove the --reranking flag from llama.cpp startup arguments unless reranking is strictly required for production use; this eliminates the /rerank endpoint entirely and removes the attack surface with no functional impact on deployments that do not use reranking. If reranking must remain active, deploy a reverse proxy such as nginx in front of the /rerank endpoint to reject POST requests where top_n is non-positive before they reach the llama.cpp process - note that this adds a dependency on correct proxy configuration. Additionally, restrict network access to the /rerank endpoint to trusted client IP ranges using firewall rules or network segmentation, reducing exposure to opportunistic external attackers.

Affected VersionsENISA

n/a n/a

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 high-performance C++ inference engine for large language models, maintained by ggml-org and widely used for local and self-hosted AI deployments. When launched with the --reranking startup flag, the HTTP server exposes a /rerank endpoint accepting POST requests with a top_n parameter that controls how many reranked results to return. The root cause is absent validation of the top_n field: a negative integer value is consumed by internal buffer or allocation logic without bounds checking, producing a std::bad_alloc C++ exception - indicating an attempt to allocate memory sized from a negative or overflow-wrapped value. The assigned CWE-674 (Uncontrolled Recursion) appears inconsistent with the described std::bad_alloc mechanism; CWE-20 (Improper Input Validation) or CWE-400 (Uncontrolled Resource Consumption) would be a more precise characterization of the root cause class. The CPE data in the input (cpe:2.3:a:n/a:n/a:*) is a placeholder and does not identify the real product; the authoritative repository is ggml-org/llama.cpp on GitHub.

Know when the next one hits your stack

  • 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

Vendor (mitre) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 7.5 HIGH

Network-reachable endpoint with no auth or interaction required; impact is availability only via crash; no scope change beyond the llama.cpp process.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE HIGH
Red Hat 7.5 HIGH

Primary rating from Vendor (mitre).

CVSS VectorVendor: mitre

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

Lifecycle Timeline

3
CVSS changed
Sep 02, 2026 - 14:22 NVD
7.5 (HIGH)
CVE Published
Sep 01, 2026 - 00:00 cve.org
HIGH 7.5
CVE Published
Sep 01, 2026 - 00:00 cve.org
UNKNOWN (no severity yet)

DescriptionCVE.org

llama.cpp through commit 97f06e9, when started with the --reranking flag, allows remote attackers to cause a denial of service (std::bad_alloc and HTTP 500) via a negative top_n value in a POST request to /rerank.

Executive ViewAI

Why It Matters

llama.cpp inference servers with the reranking feature enabled are vulnerable to remote denial-of-service attacks that crash the service without authentication. Organizations deploying this open-source LLM framework in production risk service disruptions from any network-accessible attacker. Leadership should immediately identify which deployments have reranking enabled and implement mitigations to prevent service availability incidents.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations include: disable the --reranking flag unless absolutely required; restrict network access to llama.cpp inference servers to trusted internal networks only; implement rate limiting on POST requests to the /rerank endpoint; enable monitoring and alerting for HTTP 500 errors from llama.cpp; consider deploying llama.cpp behind a reverse proxy with request validation.

Threat Intelligence Overview

EPSS Score
0.2%
Top 90% exploitable
Prevalence
Medium
popular open-source LLM inference engine with broad AI/ML community adoption
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub VulDB

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 HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
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
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Vendor StatusVendor

SUSE

Severity: Important
Product Status
openSUSE Tumbleweed Fixed

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