Track vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
8.6
CVE-2024-58400: llama.cpp lets attackers read memory with bad prompts
CVE-2024-58400 · published 9 days ago
Summary
The llama.cpp library, used by the llama-server completion API, can be tricked into reading data it shouldn’t when it receives token IDs that are outside the expected range. This could let an unauthenticated remote user view internal memory contents or cause the server to stop working. Update to version b3701 or later to fix the issue.
What to do
- Update ggml-org llama.cpp to version b3701 or later.
Affected software
| Ecosystem | Vendor | Product | Affected versions |
|---|---|---|---|
| – | ggml-org | llama.cpp | < b3701 |
| Ubuntu:26.10 | canonical | llama.cpp | All versions |
Original advisory text
llama.cpp before b3701 Out-of-Bounds Read in llama_decode via Token IDs
llama.cpp before b3701 contains an out-of-bounds read vulnerability in llama_decode_internal and llama_encode_internal that allows remote unauthenticated attackers to read memory by supplying unvalidated token IDs. Attackers can send integer-array prompts to the llama-server /completion endpoint with IDs outside 0 to n_vocab to read embedding memory out of bounds or crash the process.
References
- https://ubuntu.com/security/CVE-2024-58400 Third Party Advisory
- https://www.cve.org/CVERecord?id=CVE-2024-58400 Third Party Advisory
- https://github.com/cveproject/cvelistv5/tree/main/cves/2024/58xxx/cve-2024-58400... Third Party Advisory
- https://github.com/ggml-org/llama.cpp/blob/b3681/examples/server/server.cpp#l789 Third Party Advisory
- https://github.com/ggml-org/llama.cpp/releases/tag/b3701 Vendor Advisory
- https://github.com/ggml-org/llama.cpp/commit/eae597182cb61bbde0b26e7cec5999d28b9... Patch
- https://github.com/ggml-org/llama.cpp/commit/faf69d4237c9ae4d7f572b4674d1002463e... Patch
- https://github.com/ggml-org/llama.cpp/pull/9359 Patch
- https://github.com/ggml-org/llama.cpp/blob/b3681/examples/server/server.cpp#L789 Third Party Advisory
- https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/58xxx/CVE-2024-58400... Vendor Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2024-58400 Vendor Advisory
- https://nvd.nist.gov/vuln/detail/cve-2024-58400 Third Party Advisory
- https://www.vulncheck.com/advisories/llama-cpp-before-b3701-out-of-bounds-read-i... Vendor Advisory
Internet-facing
14 days
Internal
60 days
- Not known to be exploited
- Can be exploited automatically
- Gives an attacker partial control
Severity
8.6
High
Type
CWE-129Improper Validation of Array Index
Timeline
Published27 Oct 2026
Updated4 Nov 2026
First seen27 Oct 2026
Sources
CVE-2024-58400 · NVD
CVE-2024-58400 · OSV
CVE-2024-58400 · MITRE
UBUNTU-CVE-2024-58400 · OSV
Track software like this
Free during beta