CVE-2024-58400: llama.cpp before b3701 Out-of-Bounds Read in llama_decode via Token IDs

Published Oct 27, 2026
·
Updated

llama.cpp before b3701 contains an out-of-bounds read vulnerability in llamadecodeinternal and llamaencodeinternal 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 nvocab to read embedding memory out of bounds or crash the process.

Affected Software

3 affected components
llama.cpp llama.cpp<b3701
ubuntu/llama.cpp*
ubuntu/llama.cpp*

Event History

Oct 27, 2026
CVE Published
via MITRE·12:33 AM
Data Sourced
via MITRE·12:33 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·01:19 AM
DescriptionSeverityWeakness
Oct 28, 2026
Data Sourced
via OSV·08:15 PM
Affected Software

Frequently Asked Questions

1

Which deployments are exposed to remote exploitation?

Deployments running llama-server with the /completion endpoint reachable by an attacker are exposed, because an unauthenticated remote caller can submit integer-array prompts. The issue affects llama.cpp versions before b3701.

2

What input is required to trigger the flaw?

An attacker needs to send an integer-array prompt containing token IDs outside the valid range of 0 to n_vocab to the /completion endpoint. No authentication or user interaction is required.

3

What is the practical impact of exploitation?

Invalid token IDs can cause llama_decode_internal or llama_encode_internal to read embedding memory out of bounds. This may expose memory contents and can crash the llama-server process.

4

What should be done if an affected server cannot be patched immediately?

Restrict access to the llama-server /completion endpoint to trusted callers and prevent untrusted users from submitting integer-array prompts or out-of-range token IDs. This reduces the ability to reach the vulnerable code path.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203