PyTorch and llama.cpp: 17 model file flaws, only llama.cpp ships fixes

ZDI published 17 advisories for llama.cpp and PyTorch on 24 November, including an unauthenticated llama-server use-after-free. llama.cpp fixed all nine (first release with every fix: b12340), PyTorch closed all eight without a fix. What to update and how to contain model files.

Christopher Ort
By i10X News Desk · Reviewed by Christopher Ort · 4 min read
Share
Server rack with glowing model files being loaded into GPU cards, red warning light on one data stream
Image: AI-generated, i10X
On this page
  1. llama.cpp: fixed, but only in builds from 13 November
  2. PyTorch: eight flaws, and by policy no patch
  3. Checklist
  4. What is still open

On 24 November the Zero Day Initiative dropped 17 advisories on the two runtimes most people use to load open models: nine for llama.cpp, led by an unauthenticated use-after-free in llama-server (ZDI-26-1079, CVE-2026-131837, CVSS 8.1), and eight for PyTorch, starting with a PT2 file code injection (ZDI-26-1052). Every one of them turns a model file or a request into code running on your machine. The difference is the response: llama.cpp has merged a fix for all nine, PyTorch closed seven reports as expected behavior and one as already known, and will not patch them.

None of the 17 is known to be exploited, and only one works without someone loading a file. But model files are now routinely pulled from public hubs into notebooks, CI jobs and inference servers, which makes “open a malicious file” a lot closer to “run a download script” than the CVSS label UI:R suggests.

llama.cpp: fixed, but only in builds from 13 November

Eight of the nine llama.cpp flaws sit in GGUF parsing: integer overflows, heap buffer overflows in the Gemma 4 audio, HunyuanVL and MiniCPM-V projector code, an out-of-bounds write and read in multimodal projector (mmproj) files, and a set_swa_pattern overflow. Six reach code execution at CVSS 7.8, two are crashes at 5.5. The ninth is the server bug: with --sleep-idle-seconds set, a request arriving just before the idle timer fires could keep using the vocab after the server had freed it, according to the fix in pull request 32133. ZDI scores it AV:N/AC:H/PR:N/UI:N, so a remote caller needs no login, only good timing.

ZDI links one upstream pull request per advisory, but not a release. We traced them against the llama.cpp release tags. The fixes landed over five months, and the last four (32130 to 32133) were merged on 12 November, 174 days after ZDI reported them on 22 May. Build b12336 still lacks the server fix; b12340, published on 13 November, is the first release tag that contains all nine, and so does the stable v1.0.0 tag cut the same day, which we covered when it shipped its other server hardening.

Fix (PR)MergedZDI advisoryIssue
240914 JunZDI-26-1074Gemma 4 audio projector heap overflow, 7.8
2605124 JulZDI-26-1075set_swa_pattern heap overflow, 7.8
2707114 AugZDI-26-1072GGUF integer overflow, crash, 5.5
2927622 SepZDI-26-1073mmproj out-of-bounds read, crash, 5.5
3133628 OctZDI-26-1071GGUF integer overflow, 7.8
32130 to 3213212 NovZDI-26-1076 to 1078mmproj out-of-bounds write, HunyuanVL and MiniCPM-V overflows, 7.8
3213312 NovZDI-26-1079llama-server use-after-free on sleep, no auth, 8.1

Many people never run llama.cpp directly. Desktop apps and wrappers ship their own copy of it, so the build number that matters is the one inside the app, and it only changes when that app updates. LM Studio, for example, already had its own unauthenticated code execution bug this week.

PyTorch: eight flaws, and by policy no patch

The PyTorch set covers the newer ways of moving models around, not just the classic pickle in torch.load: PT2 archive parsing (a code injection and an exposed dangerous method), the AOTInductor package loader (a command injection and a directory traversal), the distributed checkpoint reader FileSystemReader, torch_save_to_dcp, load_compiled_function and load_state_dict_from_url. Seven score 7.8 and one 7.0; all require a victim to load the file. YJK of ZUSO ART reported seven, Alex Williams one, between July and September. According to ZDI’s timelines, PyTorch closed each within one to thirteen days, seven as expected behavior and one as a known issue.

That is consistent with the project’s own security policy, which says running untrusted models is outside what PyTorch treats as a vulnerability. Its advice is to “execute untrusted models within a secure, isolated environment such as a sandbox” and to prefer Safetensors, which it calls the format that “gives the most safety but is the most restricted in what it supports”. In practice that means the eight CVEs will stay open, and any PyTorch version should be assumed to run code from a PT2 archive, AOTInductor package or checkpoint it is told to load.

Checklist

  • llama.cpp: check llama-server --version and move to b12340 or later (or v1.0.0 or later). Rebuild containers and pinned CI images, not only laptops.
  • llama-server you cannot update yet: drop --sleep-idle-seconds and keep the port off any network an attacker can reach.
  • Apps that bundle llama.cpp: update them and check their release notes for a llama.cpp build from 13 November or later.
  • GGUF and mmproj files: load them only from publishers you trust; the projector files are where most of these bugs sat.
  • PyTorch: find where your code loads third party artifacts, for example grep -rnE "load_state_dict_from_url|load_compiled_function|FileSystemReader|AOTIModelPackageLoader|torch_save_to_dcp" ., and make sure those files only come from an artifact store you control.
  • Third party models: run them in a container or VM without credentials, and prefer Safetensors weights over PT2, AOTInductor or pickle checkpoints.

What is still open

No CVE record or advisory names an affected version range for PyTorch, and PyTorch has not said whether it will add hardening to the PT2 or AOTInductor loaders. For llama.cpp, it is unclear how many downstream apps have pulled in the 12 November fixes. We will update this article when either changes. More incidents of this kind are in our AI supply chain security section.

Christopher Ort

Christopher Ort

Christopher Ort is the editor of i10X News at i10x.ai. He has worked hands-on with AI tools, models and agent workflows for years and leads i10X’s coverage of AI launches, funding and research. He is the author of “The Style Penalty”, an SSRN study on how frontier AI models judge AI-written CVs, covered by heise online and t3n.

Editor's picks

  1. PyTorch and llama.cpp: 17 model file flaws, only llama.cpp ships fixes
  2. Analysis: Google Workspace MCP Mandate Moves AI Agents Off REST by February
  3. New York Bans AI Chatbot Toys for Five Years: Which Products the Law Covers
  4. Claude Turns Artifacts Into Mac and Windows Apps: What Full Access Allows
  5. LlamaIndex OCRia-1: Top Open Document Parser, but Free Only Under $2M Revenue