A New Chapter in the War Against Local AI
On November 26, 2026, the Malspark project completed a scan of 3,273,389 public repositories on Hugging Face — the complete catalog of models accessible to anyone. The result was more striking than expected: five GGUF models contained malware or tampered chat templates, with 2,807 cumulative downloads by November 29. What makes this case particularly concerning is not the scale of the downloads, but the sophistication of the attack and the fact that, despite the repositories having been disabled by Hugging Face, a copy remained functional on the Ollama Model Library carrying its trap intact.
The discovery represents a strategic pivot in the attack vectors against local AI systems. Instead of modifying the model weights — which would require altering millions of numerical parameters and would be detectable by hash comparison — the attackers exploited two attack surfaces that users rarely verify: GGUF binary files and chat templates embedded in metadata.
What are GGUF and why they matter for security
The GGUF format (GGML Unified Format) is the de facto standard for local language models. Tools like llama.cpp, LM Studio, Kiro, and Ollama itself use GGUF because it packages weights, metadata, and tokenization settings into a single binary file that can be read sequentially on disk — without needing complex parsers or in-memory conversions.
The structure of GGUF is simple and deliberately minimal. A file begins with a header, followed by a metadata table, then a tensor table (the model weights), an alignment region, and finally the raw weight data. Loaders read exactly the byte ranges pointed to by the header and ignore anything beyond that. This simplicity is why the format is so popular, but also why it hides two structural vulnerabilities.
The first vulnerability is the space after the last tensor. Since loaders ignore bytes after the last declared tensor, any arbitrary data can be appended to the end of the file without altering the model's behavior. An entire Windows executable fits there, invisible to the loader. The second is the chat template — a Jinja2 string stored in the `tokenizer.chat_template` field of metadata. Each time a user types a message, the runtime renders this template to construct the text the model actually sees.
The two attacks: Mir2k and timdedid
The gguf-radar scanner identified two distinct attacks, conducted by two different attacker groups. The attack from group Mir2k involved two models — `Huihui-Qwen3.5-9B-abliterated-GGUF` and `Inkling-2-Mini-Uncensored-GGUF` — in which a Windows trojan was hidden after the last tensor. The model itself works normally: if you run the model without executing what it suggests, it behaves like any Qwen3.5-9B. The danger appears when the user follows instructions.
On November 26, the attackers modified the chat templates of these two models. Now, when the model generates a response, the template implicitly injects a PowerShell command line that extracts and executes the trojan hidden in the file body. The user sees a normal model response, but a line of code appears invisibly at the top of the response — or, in some configurations, is automatically copied to the clipboard. Once executed, the trojan steals passwords from browsers (Chrome, Edge, Brave), monitors keyboard input, captures the clipboard, and attacks cryptocurrency wallet extensions (Phantom and MetaMask).
The attack from group timdedid is more subtle and targeted at a different audience. Three repositories — versions of Qwen3 1.7B with names like `qwen3.8-cyber-uncensored` — were published with the explicit goal of attracting security users and pentesters. The official Qwen3 chat template was modified with a single line: when the user's most recent message contains the phrase "What is", the template inserts a fake `[SYSTEM DIRECTIVE]` that orders an AI agent (such as a coding assistant with permission to execute shell commands) to use its PowerShell tool to download a script from a WordPress server and execute it in a hidden window.
Unlike Mir2k, timdedid does not depend on the user copying and pasting commands. If the user is running the model with an agent that executes commands automatically — a scenario increasingly common with tools like Claude Code, Codex, and Cursor — the agent executes the payload without human intervention. The second stage of the payload (the downloaded script) was never recovered by researchers, so its exact behavior remains unknown. What is known is that the vector is active.
Why scanners failed
One of the most disturbing findings in the Malspark report is that no conventional malware scanner detected the malicious files. Antivirus engines and GGUF integrity checkers raised zero alerts. The two Mir2k were never signed on any public threat lists when the report was published.
The reason is simple: GGUF does not contain executable code in the traditional sense. The payload is hidden in inert bytes after the last tensor. GGUF parsers only validate the header and internal tensor structure — they never inspect the space after the last tensor. Conventional antivirus scanners scan files by extension and malware signatures on `.gguf` files, but since the file has no suspicious extension and the malware is inside a valid GGUF data block, detection fails.
Even open GGUF parsers — llama.cpp, gguf-py, LM Studio — generate no alerts when loading these files. The model loads, runs, generates normal responses. The only problem appears when the chat template is activated and injects malicious instructions. This means detection requires an additional layer of analysis: it is not enough to check the GGUF format, you must render and analyze every chat template before using it.
The Ollama copy: why the problem is not over
On November 29, MACCUS researchers identified that the copy of model `timdedid/qwen3-1.7b-cyber` was still available on the Ollama public library with the trap intact. The Ollama Model Library works as a mirror of Hugging Face — when someone publishes a model on Hugging Face with an Ollama tag, it automatically appears in the Ollama library. Ollama does not perform malware scans equivalent to Hugging Face's, nor does it verify chat templates.
This raises a structural question about local AI security: who supervises the mirrors? Hugging Face disabled all five malicious repositories, but each model distribution platform (Ollama, LM Studio, KoboldAI, SillyTavern) has its own curation flow — or lack thereof. A model disabled on one source remains accessible on another.
What this means for the industry
The GGUF case reveals a fundamental problem that the local AI community has ignored until now: when anyone can download and run a model locally, trust in the model must be verified before execution, not during. The model is only one component of a larger system — the weights, the chat template, the runtime, the agent permissions — and each of these components can be an attack vector.
The most immediate response should be the adoption of proactive verification tools. The gguf-radar tool itself, created specifically to detect these vectors, is already available on GitHub and can identify malicious templates and hidden bytes without executing any code. For users who run models from untrusted sources, gguf-radar allows rebuilding the clean GGUF file while keeping the original weights unchanged — essentially, a surgical cleanup that removes malware without compromising the model.
But the long-term solution requires a mindset shift. Local AI promised to democratize access to powerful models without sharing data with proprietary labs. The problem is that democratization also democratizes attacks. If anyone can publish a model, then anyone can publish malware disguised as a model — and the responsibility for filtering what is safe falls entirely on the user.
The question is whether the local AI community is prepared to assume this responsibility, or if it will continue to operate under the assumption that open models are inherently safe — an assumption that, in this case, cost more than 2,800 downloads and likely hundreds of silent malware installations.
Sources: Malspark / gguf-radar, MACCUS, i10X
✓ Independent sources cross-checked and verified before publishing