ZeroHour

CVE-2026-52132

niche

Unauthenticated DoS in llama.cpp /rerank endpoint via negative top_n

CVSS 3.1
7.5 high
EPSS
<1%p26
Published
()
Modified
AI analysis

llama.cpp builds through commit 97f06e9 fail to handle a negative top_n value in POST requests to the /rerank endpoint, producing an out-of-memory condition (std::bad_alloc, classified as uncontrolled recursion per CWE-674) that is surfaced as an HTTP 500 error. The flaw is triggered remotely and without authentication whenever a server process is started with the --reranking flag and accepts requests at /rerank. An attacker who can reach the endpoint can disrupt availability, either crashing the process or making rerank requests fail, with no confidentiality or integrity impact (CVSS 3.1: AV:N/AC:L/PR:N/UI:N, A:H). Only deployments running the llama.cpp HTTP server with reranking enabled are affected; instances run without the --reranking flag, or whose /rerank endpoint is not reachable by untrusted clients, are not exposed. No public proof of concept exists, it is not in CISA's KEV catalog, and EPSS estimates a 0.3% probability of exploitation within 30 days, so no in-the-wild exploitation is currently known.

What to do: Upgrade to a llama.cpp build newer than commit 97f06e9 once a patched release is available, since the advisory does not name a fixed version. As interim mitigations, avoid starting the server with --reranking unless reranking is required, restrict /rerank to trusted clients or place authentication in front of it, and reject requests with a negative top_n at a reverse proxy. Monitor /rerank for HTTP 500 responses as a possible sign of probing.

Affected
ggml llama.cppAll builds through commit 97f06e9, when the server is started with the --reranking flag; the advisory data does not specify a fixed version or commit
Estimated exposure
nichelikely hundreds to low thousands of affected deployments at most (estimate; llama.cpp has very broad self-hosted adoption, but only instances running the HTTP… — llama.cpp is one of the most widely used self-hosted LLM inference engines, but the affected population is narrowed by the uncommon --reranking startup flag and the fact that most instances run locally or behind internal tooling rather…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

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.

Vendors
ggml
Products
llama.cpp
Weakness
CWE-674
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

In the news

No ingested article mentions this CVE yet.