Security Resilience

CVE-2026-27940

Memory Safety

Published
12 March 2026
Modified
12 March 2026
CVSS Score v3.1 7.8
Click a component to see what it means
Raw vectorCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS Score 0.0019 8th percentile
Risk Priority 55 floored blend · peak EPSS

CVSS 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

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

T1203 Exploitation for Client Execution Execution
Adversaries may exploit software vulnerabilities in client applications to execute code.
T1068 Exploitation for Privilege Escalation Privilege Escalation
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
T1189 Drive-by Compromise Initial Access
Adversaries may gain access to a system through a user visiting a website over the normal course of browsing.
T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1210 Exploitation of Remote Services Lateral Movement
Adversaries may exploit remote services to gain unauthorized access to internal systems once inside of a network.
T1212 Exploitation for Credential Access Credential Access
Adversaries may exploit software vulnerabilities in an attempt to collect credentials.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-70638Shared CWE-122, CWE-190
CVE-2026-33298Shared CWE-122, CWE-190
CVE-2025-26639Shared CWE-122, CWE-190
CVE-2026-25173Shared CWE-122, CWE-190
CVE-2026-56182Shared CWE-122, CWE-190
CVE-2026-54109Shared CWE-122, CWE-190
CVE-2026-69408Shared CWE-122, CWE-190
CVE-2026-41445Shared CWE-122, CWE-190
CVE-2026-50347Shared CWE-122, CWE-190
CVE-2025-3277Shared CWE-122, CWE-190

Affected Assets

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

—

Detect
Catch it (NIST detect / respond)

—

Harden
Shrink the surface (DISA STIG)

—

Validate
Prove the fix (OWASP ASVS)
  • V1.4.1
  • V5.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.

PR.PS-06 full match
blocks

Secure-development practices directly require bounds checking and safe memory handling that prevent heap overflows.

ID.RA-01 partial match
blocks

Vulnerability scanning and recording can discover heap-overflow flaws but does not prevent their introduction in code.

PR.PS-02 partial match
blocks

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.

finds

Security testing in development and acceptance can detect heap overflows before release.

prevents

Secure coding standards directly prescribe techniques (safe functions, bounds checks) that prevent heap-based buffer overflows.

References