---
id: "CVE-2026-116816"
kind: "vulnerability"
aliases: ["CVE-2026-116816"]
title: "llama.cpp: crafted GGUF model tokenizer writes heap memory out of bounds"
severity: "high"
cvss: 8.5
epss: null
exploited: false
status: "open"
category: "ai-tooling"
products: []
ecosystems: []
tags: ["ai-tooling", "gguf", "llama.cpp", "self-hosted"]
not_affected_if: ["fixed-build", "trusted-models-only"]
published_at: "2026-10-27T01:19:06+00:00"
first_seen_at: "2026-10-27T01:34:33+00:00"
updated_at: "2026-10-27T01:36:16+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-116816", "first_seen_at": "2026-10-27T01:34:33+00:00"}]
---

# llama.cpp: crafted GGUF model tokenizer writes heap memory out of bounds

llama.cpp's PLaMo-2 tokenizer accepts a byte token such as <0x-1> whose negative value writes token ids before its heap buffer while a model loads. A crafted GGUF model file can corrupt heap memory, causing crashes or possibly code execution.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `llama-cli --version` or check the build tag and compare it against `b10261`; builds from `b5899` up to but not including `b10261` are affected.
- Check whether any GGUF model files loaded by llama.cpp come from untrusted sources.

## Fix

- Upgrade llama.cpp to build `b10261` or later.
- Load only GGUF models from trusted sources until upgraded.

## Timeline

- 2026-10-27T01:34:33+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-116816

## From the sources

llama.cpp b5899 before b10261 contains a heap out-of-bounds write vulnerability in llm_tokenizer_plamo2::build that allows attackers to corrupt heap memory via crafted GGUF models. Attackers can supply BYTE-typed token text like <0x-1> whose negative parsed value writes token ids before the bytes_ buffer during model loading, causing crashes or potential code execution.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
