CVE-2026-52132

Denial of Service via Negative top_n in llama.cpp Reranking Endpoint

Published Sep 1, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

A remote attacker can cause a denial of service by sending a POST request to the /rerank endpoint of the llama.cpp library when the program has been started with the --reranking flag. The attacker exploits a flaw in which a negative top_n value is not validated before being passed to C++ code. This causes a std::bad_alloc exception, resulting in the server returning an HTTP 500 error and temporarily halting the service. The weakness is an input validation flaw that lets malformed data crash the process.

Affected Systems

The open‑source llama.cpp project contains the vulnerability in any build that has the reranking feature enabled prior to commit 97f06e9. Developers and operators who build or deploy those versions and expose the /rerank endpoint are impacted. No vendor or product information is supplied for this CVE.

Risk and Exploitability

With a CVSS score of 7.5 and an EPSS score of less than 1 %, the attack surface is relatively low, yet the denial‑of‑service outcome can be achieved with a single, unauthenticated POST request. The endpoint is reachable over HTTP and likely does not require authentication, making the risk broader for exposed deployments. Although the vulnerability is not yet listed in CISA’s KEV catalog, the remote nature and potential to disrupt service warrant timely mitigation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade llama.cpp to a commit after 97f06e9 or apply a backport that sanitizes top_n input.
  • Disable the --reranking flag or remove the /rerank endpoint if the feature is not required.
  • Add server‑side validation to reject negative top_n values before they reach llama.cpp.

Generated by OpenCVE AI on September 3, 2026 at 17:33 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Ggml
Ggml llama.cpp
CPEs cpe:2.3:a:ggml:llama.cpp:*:*:*:*:*:*:*:*
Vendors & Products Ggml
Ggml llama.cpp
Type Values Removed Values Added
Title Denial of Service via Negative top_n in llama.cpp Reranking Endpoint
Type Values Removed Values Added
Title Remote Denial of Service via Negative top_n Value in llama.cpp Reranking Endpoint
Weaknesses CWE-20
Type Values Removed Values Added
Weaknesses CWE-674
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Title Remote Denial of Service via Negative top_n Value in llama.cpp Reranking Endpoint
Weaknesses CWE-20
Type Values Removed Values Added
First Time appeared Ggml-org
Ggml-org llama.cpp
Vendors & Products Ggml-org
Ggml-org llama.cpp
Type Values Removed Values Added
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.
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
Sep 2, 2026, 1:47 PM
Reserved
Jun 8, 2026, 12:00 AM
Status
Analyzed
Published
Sep 1, 2026, 6:17 PM
Modified
Sep 4, 2026, 8:15 PM