ZDI-26-1079: llama.cpp server_context_impl destroy vocab Use-After-Free Remote Code Execution Vulnerability
Summary
A Use-After-Free Remote Code Execution (RCE) vulnerability has been identified in the server_context_impl component of llama.cpp (ZDI-26-1079 / CVE-2026-131837). Featuring a CVSS score of 8.1 (High Severity), this vulnerability allows unauthenticated remote attackers to execute arbitrary code on affected installations.
Affected Products
- llama.cpp (versions prior to the fix implemented in Pull Request #32133)
Technical Details
The specific flaw exists within the handling of HTTP requests during the server's sleep transition inside server_context_impl. The application fails to validate the existence of an object prior to performing operations on it (Use-After-Free condition during vocab destruction). An attacker can leverage this flaw without authentication to execute arbitrary code within the context of the service account running llama.cpp.
Impact
Successful exploitation allows remote attackers to execute arbitrary code on the target system without authentication.
- Confidentiality: High — Attackers can read sensitive data and memory content via arbitrary code execution.
- Integrity: High — Attackers can modify files, tamper with application data, or alter system configurations.
- Availability: High — Attackers can crash the server process or cause complete loss of service availability.
Mitigation & Remediation Recommendations
- Update the llama.cpp deployment to the commit/release incorporating GitHub Pull Request #32133.
- Restrict network access to the llama.cpp HTTP server interface to trusted hosts or internal networks only.
- Apply the principle of least privilege to the service account executing llama.cpp to limit post-exploitation impact.
References
- Source Advisory Link (ZDI-26-1079) — http://www.zerodayinitiative.com/advisories/ZDI-26-1079/
- llama.cpp Fix Patch (GitHub Pull Request #32133) — https://github.com/ggml-org/llama.cpp/pull/32133
- Official llama.cpp Repository — https://github.com/ggml-org/llama.cpp
- NVD Vulnerability Detail (CVE-2026-131837) — https://nvd.nist.gov/vuln/detail/CVE-2026-131837
- MITRE CVE Record (CVE-2026-131837) — https://www.cve.org/CVERecord?id=CVE-2026-131837
Advisory ini disajikan tim ICT Cybersecurity PT Pertamina Bina Medika IHC sebagai informasi kesadaran keamanan. Verifikasi pada sumber resmi sebelum tindakan.