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.
{
"cna_assigner": "VulnCheck",
"cwe_ids": [
"CWE-129"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/58xxx/CVE-2024-58400.json"
}{
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"fixed": "b3701"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandardRange"
},
{
"range": [
{
"fixed": "faf69d4237c9ae4d7f572b4674d1002463e8acd3"
}
],
"source": "REFERENCES_COMMIT"
},
{
"range": [
{
"fixed": "eae597182cb61bbde0b26e7cec5999d28b9327fe"
}
],
"source": "REFERENCES_COMMIT"
},
{
"original_tag": "b3701",
"range": [
{
"fixed": "eae597182cb61bbde0b26e7cec5999d28b9327fe"
}
],
"source": "REFERENCES_TAG"
}
]
}
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-58400.json"
[
{
"deprecated": false,
"digest": {
"line_hashes": [
"262616711565607998422697631506032163130",
"176115092634269479907053456416472576902",
"100719932489893206947687017114112475026",
"262616711565607998422697631506032163130",
"176115092634269479907053456416472576902",
"100719932489893206947687017114112475026"
],
"threshold": 0.9
},
"id": "CVE-2024-58400-318437c0",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/ggml-org/llama.cpp/commit/faf69d4237c9ae4d7f572b4674d1002463e8acd3",
"target": {
"file": "src/llama.cpp"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"162984747226065337547035042875857125025",
"70731550095321465544944619383573268122",
"3486518891541896139948938885908864163",
"53712956802570192535062892247107293960",
"255854875032501693010943805894256611123",
"56152727761624032627803593923847083536",
"16811007308301923997870801096065786844"
],
"threshold": 0.9
},
"id": "CVE-2024-58400-354b5738",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/ggml-org/llama.cpp/commit/faf69d4237c9ae4d7f572b4674d1002463e8acd3",
"target": {
"file": "common/common.cpp"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "255971704941725637887413594854918447425",
"length": 2963
},
"id": "CVE-2024-58400-3f7c00d8",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/ggml-org/llama.cpp/commit/faf69d4237c9ae4d7f572b4674d1002463e8acd3",
"target": {
"file": "common/common.cpp",
"function": "llama_init_from_gpt_params"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "266993482376888250179210687491670458661",
"length": 3385
},
"id": "CVE-2024-58400-8583a4ba",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/ggml-org/llama.cpp/commit/faf69d4237c9ae4d7f572b4674d1002463e8acd3",
"target": {
"file": "src/llama.cpp",
"function": "llama_encode_internal"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "284883501299586576290295201937289723696",
"length": 5178
},
"id": "CVE-2024-58400-94726cfb",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/ggml-org/llama.cpp/commit/faf69d4237c9ae4d7f572b4674d1002463e8acd3",
"target": {
"file": "src/llama.cpp",
"function": "llama_decode_internal"
}
}
]
"2026-10-29T07:31:31Z"