Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

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

Quick assessment

Affected
ggml-org llama.cpp
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

b3701 版本之前的 llama.cpp 在 和 函数中存在越界读取漏洞。该漏洞允许远程未认证的攻击者通过提供未经验证的 token ID 来读取内存。攻击者可以向 llama-server 的 端点发送包含超出 0 到 n_vocab 范围的 ID 的整数数组提示,从而越界读取嵌入(embedding)内存或导致进程崩溃。

CVSS 8.2 · High

Possible ATT&CK Techniques 1 AI

T1190 · Exploit Public-Facing Application
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2024-58400

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
llama.cpp before b3701 Out-of-Bounds Read in llama_decode via Token IDs
Source: CVE Program / CVE List V5
Vulnerability 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.
Source: CVE Program / CVE List V5
CVSS Information
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
Source: CVE Program / CVE List V5
Vulnerability Type
对数组索引的验证不恰当
Source: CVE Program / CVE List V5

Affected Products

Vendor Product Affected Versions CPE Subscribe
ggml-org llama.cpp 0 ~ b3701 -

II. Public POCs for CVE-2024-58400

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2024-58400

请登录查看更多情报信息。

Other References for CVE-2024-58400 (6)

Same Patch Batch · ggml-org · 2026-10-27 · 6 CVEs total

CVE-2026-116816 7.8 HIGH llama.cpp b5899 before b10261 Heap Out-of-Bounds Write via plamo2 Tokenizer
CVE-2026-116829 6.6 MEDIUM llama.cpp b10398 before b11301 Integer Overflow in gguf_init_from_reader
CVE-2026-116840 6.1 MEDIUM llama.cpp b5854 before b11275 Integer Overflow in gguf_init_from_reader
CVE-2024-58399 6.1 MEDIUM llama.cpp before b2731 Out-of-Bounds Read via GGUF Tensor Offsets
CVE-2025-71439 5.5 MEDIUM llama.cpp before b5649 Heap Out-of-Bounds Read via llama_vocab::impl::print_info

IV. Related Vulnerabilities