CVE-2024-58400: llama.cpp out-of-bounds read in decode/encode functions

CVE-2024-58400 · Severity: high · CVSS 8.2 · Published 2026-10-27

llama.cpp is a language model inference library used to run AI models locally. An unauthenticated attacker can send specially crafted requests to the llama-server endpoint with invalid token IDs, causing the server to read memory outside intended bounds. This can leak sensitive data from memory or crash the service.

Technologies: Ggml-Org Llama.Cpp. Vendors: Ggml-Org.

Quick answers

Is CVE-2024-58400 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2024-58400 being exploited in the wild.
How severe is CVE-2024-58400?
High severity, with a CVSS score of 8.2, published 27 October 2026.
Which products and versions are affected?
Ggml-Org Llama.Cpp before b3701.
Is there a fix for CVE-2024-58400?
Yes: fixed in b3701 or later (commit eae5971 and related). Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2024-58400 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2024-58400?
Check whether you run Ggml-Org Llama.Cpp at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Fixed in: b3701 or later (commit eae5971 and related)

Technical details

An out-of-bounds read vulnerability exists in llama_decode_internal and llama_encode_internal functions due to insufficient validation of token ID values. The functions fail to check that token IDs fall within the valid range (0 to n_vocab), allowing attackers to read arbitrary embedding memory via the /completion endpoint by supplying integer-array prompts with IDs outside valid bounds.

Affected products

  • ggml-org llama.cpp before b3701

Timeline

  • 2026-10-27: disclosed

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.