Raw vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HCVSS and EPSS are reproduced from their sources (NVD, FIRST EPSS). Risk Priority is our own derived reading, not an NVD score.
Summary
CVE-2026-27940 is a high-severity Heap-based Buffer Overflow (CWE-122) vulnerability. Its CVSS base score is 7.8 (High).
Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Client Execution (T1203); ranked at the 8th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.
This vulnerability is AI-related — categorised as NLP and Transformers; in the Data-Related Vulnerabilities risk domain.
The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.
Deeper analysis AI-assisted summary
Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.
CVE-2026-27940 is an integer overflow vulnerability in the gguf_init_from_file_impl() function within gguf.cpp of llama.cpp, a C/C++ inference engine for large language models (LLMs). Affecting versions prior to commit b8146, the flaw triggers an undersized heap allocation, enabling a subsequent fread() operation to write over 528 bytes of attacker-controlled data beyond the buffer boundary, resulting in a heap buffer overflow. This issue is classified under CWE-122 (Heap-based Buffer Overflow) and CWE-190 (Integer Overflow or Wraparound), with a CVSS v3.1 base score of 7.8.
The vulnerability requires a local attacker with no privileges who can trick a user into loading a malicious GGUF file into llama.cpp (AV:L/AC:L/PR:N/UI:R). Successful exploitation allows arbitrary code execution or system compromise due to the high impacts on confidentiality, integrity, and availability (C:H/I:H/A:H), as the overflow permits overwriting adjacent heap memory with controlled data.
The GitHub security advisory at https://github.com/ggml-org/llama.cpp/security/advisories/GHSA-3p4r-fq3f-q74v confirms the issue as a bypass of a prior similar vulnerability (CVE-2025-53630) in the same file, where the fix overlooked certain code paths. Mitigation involves updating to commit b8146 or later.
This flaw is particularly relevant in AI/ML contexts, as llama.cpp is widely used for efficient LLM inference on local systems, potentially exposing practitioners running unpatched inference workloads to local file-based attacks. No public evidence of real-world exploitation has been reported.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2026-11605
Vulnerability Data
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…
more
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.
- CWE(s)
AI Security AnalysisAI
- AI Category
- NLP and Transformers
- Risk Domain
- Data-Related Vulnerabilities
- OWASP Top 10 for LLMs 2025
- None mapped
- Classification Reason
- Matched keywords: llama.cpp, llm
Related Threats
MITRE ATT&CK Enterprise Techniques
CVEs Like This One
Affected Assets
Mitigating Controls
Control response
—
—
—
V1.4.1V5.2.6
Mitigating Controls (NIST 800-53 r5) AI
Developer testing and evaluation (including fuzzing and memory-error detectors) can discover heap overflows after they have been coded.
Input validation enforces bounds checking on data written to heap buffers, directly stopping the overflow condition from being introduced.
Security engineering principles require use of memory-safe constructs and bounds-checked allocation routines that avoid introducing heap overflows.
Memory-protection mechanisms limit the ability of a heap overflow to execute attacker-controlled code or corrupt adjacent structures.
Mitigating Controls (NIST CSF 2.0) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.
Secure-development practices directly require bounds checking and safe memory handling that prevent heap overflows.
Vulnerability scanning and recording can discover heap-overflow flaws but does not prevent their introduction in code.
Timely patching removes known heap-overflow instances after they exist.
Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.
Security testing in development and acceptance can detect heap overflows before release.
Secure coding standards directly prescribe techniques (safe functions, bounds checks) that prevent heap-based buffer overflows.