ZDI-26-1075: llama.cpp GGUF File Parsing set_swa_pattern Heap-based Buffer Overflow Remote Code Execution Vulnerability
Summary
This security advisory covers a Remote Code Execution (RCE) vulnerability in llama.cpp, tracked under CVE-2026-131833 and ZDI-26-1075. The flaw is caused by a heap-based buffer overflow within the set_swa_pattern function during GGUF file parsing. Exploitation requires user interaction, requiring a target to open a malicious file or visit a malicious page.
Affected Products
- llama.cpp (versions prior to the fix in Pull Request #26051)
Technical Details
The specific flaw exists within the parsing of GGUF files in llama.cpp. The issue stems from the lack of proper validation of the length of user-supplied data prior to copying it to a fixed-length, heap-based buffer. An attacker can leverage this vulnerability to execute arbitrary code in the context of the current process. The vulnerability carries a CVSS v3 score of 7.8 (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
Impact
An attacker can execute arbitrary code in the context of the current process running llama.cpp.
- Confidentiality: High — Code execution allows the attacker to access sensitive process memory and data.
- Integrity: High — Attackers can modify memory content and take control of process execution flow.
- Availability: High — Heap memory corruption can lead to application crashes and denial of service.
Mitigation & Remediation Recommendations
- Update llama.cpp to the latest version incorporating the patch from Pull Request #26051.
- Exercise caution and refrain from opening GGUF files from untrusted or unknown sources.
- Implement least privilege principles for application execution to limit potential exploitation scope.
References
- Source Advisory Link — http://www.zerodayinitiative.com/advisories/ZDI-26-1075/
- llama.cpp Fix (GitHub PR #26051) — https://github.com/ggml-org/llama.cpp/pull/26051
- NVD CVE-2026-131833 Detail — https://nvd.nist.gov/vuln/detail/CVE-2026-131833
- MITRE CVE Record CVE-2026-131833 — https://www.cve.org/CVERecord?id=CVE-2026-131833
- Official llama.cpp Repository — https://github.com/ggml-org/llama.cpp
Advisory ini disajikan tim ICT Cybersecurity PT Pertamina Bina Medika IHC sebagai informasi kesadaran keamanan. Verifikasi pada sumber resmi sebelum tindakan.