{"id":"CVE-2024-58400","kind":"vulnerability","aliases":["CVE-2024-58400"],"related":[],"title":"llama.cpp: out-of-bounds read via unvalidated token IDs in llama-server","description":"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.","summary":"llama.cpp before b3701 does not validate token IDs in llama_decode_internal and llama_encode_internal, so an out-of-range ID reads memory outside the embedding table. A remote unauthenticated attacker sending integer-array prompts to the llama-server /completion endpoint can read process memory or crash the server.","severity":"high","cvss":8.8,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["ai-tooling","llama-server","llama.cpp","local-llm","self-hosted"],"not_affected_if":["auth-required","no-network-exposure"],"how_to_check":"- Run `llama-server --version` or check the build tag on the host; anything older than `b3701` is affected.\n- Check whether the llama-server port is reachable from untrusted networks.","fix":"- Upgrade llama.cpp to `b3701` or later and rebuild llama-server.\n- Until upgraded, restrict network access to the llama-server /completion endpoint.","status":"open","published_at":"2026-10-27T01:19:03+00:00","first_seen_at":"2026-10-27T01:34:33+00:00","triaged_at":"2026-10-27T01:36:16+00:00","updated_at":"2026-10-27T01:36:16+00:00","category":"ai-tooling","confidence":0.7,"triage":{"at":"2026-10-27T01:36:16Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade llama.cpp to `b3701` or later and rebuild llama-server.\n- Until upgraded, restrict network access to the llama-server /completion endpoint.","reach":"internet","title":"llama.cpp: out-of-bounds read via unvalidated token IDs in llama-server","impact":"medium","summary":"llama.cpp before b3701 does not validate token IDs in llama_decode_internal and llama_encode_internal, so an out-of-range ID reads memory outside the embedding table. A remote unauthenticated attacker sending integer-array prompts to the llama-server /completion endpoint can read process memory or crash the server.","category":"ai-tooling","nicknames":[],"who_cares":["llama.cpp","llama-server","self-hosted","local-llm"],"confidence":0.7,"needs_auth":"no","worst_case":"Process memory is read remotely, or the server crashes","analyst_note":"Confirm the fixed version (b3701) and whether the advisory's exposed-network scenario applies by checking the llama.cpp GitHub advisory for CVE-2024-58400.","how_to_check":"- Run `llama-server --version` or check the build tag on the host; anything older than `b3701` is affected.\n- Check whether the llama-server port is reachable from untrusted networks.","needs_analyst":true,"not_affected_if":["auth-required","no-network-exposure"],"who_is_affected":"Teams that run llama-server from llama.cpp and expose its HTTP API to clients beyond the host, since the /completion endpoint accepts raw integer-array token prompts from any caller. Local-only use behind authentication or with no network exposure is lower risk. Teams using llama.cpp only as a library with no server exposed can skip the server-specific checks.","user_interaction":"no","needs_special_setup":"unknown","severity_if_unknown":"high"},"cost_usd":0.000656,"input_tokens":3353,"output_tokens":641,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-2024':16A,19A '-58400':17A,20A '/completion':77B,131C '0':136C 'ai':22B 'ai-tool':21B 'allow':107C 'array':70B,124C 'attack':66B,110C,119C 'b3701':36B,89C 'bound':5A,95C,146C 'contain':90C 'crash':84B,148C 'cve':15A,18A 'decod':44B,100C 'embed':61B,142C 'encod':48B,104C 'endpoint':78B,132C 'host':33B 'id':10A,41B,56B,118C,134C 'integ':69B,123C 'integer-array':68B,122C 'intern':45B,49B,101C,105C 'llama':13A,25B,43B,47B,75B,99C,103C,129C 'llama-serv':12A,24B,74B,128C 'llama.cpp':1A,27B,34B,87C 'llm':30B 'local':29B 'local-llm':28B 'memori':58B,82B,113C,143C 'n':138C 'out-of-bound':2A,92C 'out-of-rang':52B 'outsid':59B,135C 'process':81B,150C 'prompt':71B,125C 'rang':55B 'read':6A,57B,80B,96C,112C,141C 'remot':64B,108C 'self':32B 'self-host':31B 'send':67B,121C 'server':14A,26B,76B,86B,130C 'suppli':115C 'tabl':62B 'token':9A,40B,117C 'tool':23B 'unauthent':65B,109C 'unvalid':8A,116C 'valid':39B 'via':7A 'vocab':139C 'vulner':97C","nicknames":[],"mitigations":[],"who_affected":"Teams that run llama-server from llama.cpp and expose its HTTP API to clients beyond the host, since the /completion endpoint accepts raw integer-array token prompts from any caller. Local-only use behind authentication or with no network exposure is lower risk. Teams using llama.cpp only as a library with no server exposed can skip the server-specific checks.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-27T01:19:03+00:00","kev":null,"cvss_vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cvss_by":"disclosure@vulncheck.com","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2024-58400","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58400","severity":null,"published_at":"2026-10-27T01:19:03+00:00","modified_at":"2026-10-27T01:19:03+00:00","first_seen_at":"2026-10-27T01:34:33+00:00","fetched_at":"2026-10-27T01:34:33+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}