{"id":"CVE-2026-27940","published":"2026-03-12T16:39:37Z","modified":"2026-03-14T03:55:24Z","title":"llama.cpp has a Heap Buffer Overflow via Integer Overflow in `mem_size` Calculation — Bypass of CVE-2025-53630 Fix","vendor":"ggml-org","product":"llama.cpp","tier":"tail","description":{"text":"llama.cpp is an inference of several LLM models in C/C++. Prior to b8146, the gguf_init_from_file_impl() in gguf.cpp is vulnerable to an Integer overflow, leading to an undersized heap allocation. Using the subsequent fread() writes 528+ bytes of attacker-controlled data past the buffer boundary. This is a bypass of a similar bug in the same file - CVE-2025-53630, but the fix overlooked some areas. This vulnerability is fixed in b8146.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00188,"percentile":0.08403,"provenance":"source"},"cwes":[{"id":"CWE-122","name":"Heap-based Buffer Overflow"},{"id":"CWE-190","name":"Integer Overflow or Wraparound"}],"references":[{"url":"https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-3p4r-fq3f-q74v","tags":["x_refsource_CONFIRM"]}],"priority":{"score":12.1,"factors":[{"name":"EPSS percentile","points":1.68},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":5.46}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2026-03-29","earliestUrl":"https://github.com/ngtuonghung/CVE-2026-27940","repos":[{"name":"ngtuonghung/CVE-2026-27940","url":"https://github.com/ngtuonghung/CVE-2026-27940","stars":1,"created":"2026-03-29"}]},"first":{"date":"2026-03-29","source":"PoC-in-GitHub","url":"https://github.com/ngtuonghung/CVE-2026-27940"},"provenance":"source"},"vendorSlug":"ggml-org","affectedVersions":[{"vendor":"ggml-org","product":"llama.cpp","versions":["< b8146"]}],"euvd":{"id":"EUVD-2026-11605","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-ggml-org-llama-cpp-cve-2025-53630","parents":[{"from":"CVE-2025-53630","to":"CVE-2026-27940","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"text","provenance":"source","relation":"related","quote":"This is a bypass of a similar bug in the same file - CVE-2025-53630, but the fix overlooked some areas.","from":"CVE.org","in":"CVE-2026-27940"},{"kind":"similar","provenance":"machine","score":0.4,"basis":"same product + CWE + description similarity"}]}]}}