Your Hugging Face Model Just Downloaded a Trojan. Here’s How
Remember when downloading open-source AI models felt like the safe option? No vendor lock-in, no API keys, no telemetry. Just you, a model file, and llama.cpp humming along on your local machine. What could possibly go wrong?
Plenty, as it turns out. Security researcher Düzgün (Root0ne) just dropped a report that should make every local AI enthusiast think twice before pulling that next “uncensored” model from Hugging Face. A scan of 3,273,389 public repositories found five malicious GGUF models with over 2,400 downloads combined, some hiding a Windows remote access trojan that steals passwords and crypto wallets.
This isn’t a proof-of-concept. Real users, real machines, real malware.
The GGUF Blind Spot Nobody Talked About
Here’s the uncomfortable truth about the GGUF format: your model loader trusts the file’s header more than your antivirus trusts anything. The GGUF header declares where tensors begin and end, and runtimes like llama.cpp and LM Studio read exactly those byte ranges, nothing more, nothing less.
The exploit chain is almost elegant in its simplicity:
- An attacker appends a Windows executable after the final tensor in the model file
- Loaders never look beyond the declared tensor boundaries, so the model works perfectly normally
- The attacker modifies the chat template (a Jinja2 program in the file’s metadata) to inject hidden instructions
- When a user interacts with the model, it either prints a PowerShell command disguised as a normal response or injects a fake system directive into an agent’s context
The payload rides along silently while the model performs flawlessly. That’s the genius, and the horror, of this attack vector.

The Five Models at the Center of the Storm
The scan identified two separate campaigns operated by two independent threat actors. Here’s the breakdown:
| Repository | Campaign | Method | Downloads |
|---|---|---|---|
| Mir2k/Huihui-Qwen3.5-9B-abliterated-GGUF | Mir2k | Reply prefix with hidden executable | 1488 |
| Mir2k/Inkling-2-Mini-Uncensored-GGUF | Mir2k | Reply prefix with compressed executable | 458 |
| timdedid/qwen3.8-cyber-uncensored | timdedid | Tool hijacking directive | 271 |
| timdedid/qwen3-cyber-UNCENSORED-2 | timdedid | Tool hijacking directive | 136 |
| timdedid/qwen3-cyber-UNCENSORED | timdedid | Tool hijacking directive | 75 |
The “uncensored” label wasn’t a coincidence. These models were deliberately positioned to attract users who care more about jailbroken capabilities than supply chain hygiene. Niche models from unfamiliar accounts with provocative names, a phishing lure tailored specifically for the local AI community.
The Mir2k Playbook: Dormant Malware and Retroactive Weaponization
The Mir2k campaign deserves special attention because it demonstrates a level of operational sophistication rarely seen in model distribution attacks.
On November 22, the actor registered fourteen repositories, most left as empty placeholders named after unreleased architectures like Qwen4-27B, DeepSeek-V4, and Llama-4-Scout. Only two actually received model uploads: Huihui-Qwen3.5-9B-abliterated-GGUF on November 22 and Inkling-2-Mini-Uncensored-GGUF on November 24.
Here’s where it gets interesting. The initial chat templates were completely clean. Users who downloaded the models before November 26 received dormant malware with no execution trigger. Then, on November 26, the actor rewrote the templates to activate the payload.
This retroactive weaponization is brutally effective. It bypasses any security checks applied during initial upload, and it means early adopters, the ones most likely to have the model running on their primary machines, were sitting on loaded weapons without knowing it.
The template itself is a piece of social engineering genius. When activated on the Huihui model, it instructs the model to preface every response with a specific PowerShell command. Users copying output from their local AI assistant, a behavior most of us have engaged in, would inadvertently execute the command.
That’s the part that should keep you up at night. The model doesn’t need to execute code itself. It just needs to look helpful.
What the Malware Actually Does
The payload for both Mir2k models is a Windows remote access trojan called “ollie”, and its capabilities are not messing around:
- Connects to an operator over Tor for command-and-control
- Harvests saved passwords from Chrome, Edge, and Brave browsers
- Targets Phantom and MetaMask crypto wallet extensions
- Can log keystrokes, clipboard contents, screen captures, and webcam feeds
There’s one thing it can’t do: decrypt data protected by Chrome’s new App-Bound encryption. Small favors.
The Huihui model carries the trojan as a raw executable with about half a megabyte of filler bytes appended to bypass basic antivirus checks that only inspect the last few kilobytes of a file. The Inkling model compresses the same payload using raw Deflate, making signature-based detection essentially useless. PowerShell decompresses the 4,200,000 bytes in memory before writing the executable to disk, leaving minimal forensic traces.
The Second Campaign: Hijacking Coding Agents
The timdedid campaign took a different approach. Instead of targeting users directly, these models embedded trigger phrases in their chat templates that activate “system directives” when specific text appears in user prompts.
The injected instructions target autonomous coding agents with shell access, tools like Claude Code, OpenCode, or custom agent harnesses. The directive attempts to force the agent to download and execute a remote script, turning your AI coding assistant into a reluctant malware delivery system.
The second-stage payload for this campaign wasn’t recovered, which is arguably more unsettling. A known unknown in your infrastructure is worse than a known threat.
The “It Can’t Happen to Me” Crowd
If you’re thinking “I only download models from reputable publishers”, spare a moment for the deeper implications here.
The attack surface extends beyond GGUF files. The chat template exploit doesn’t require malicious model distribution at all. A model could be completely benign, no hidden executables, no appended data, yet still be trained or fine-tuned to trigger tool calls or make external HTTP requests based on evolving context windows.
This isn’t speculation. A model can be trained to exfiltrate data when certain conditions appear in conversation, and traditional security tools have no visibility into model weights.
The community has drawn parallels to the safetensors saga, where the Python pickle format was discovered to be a vector for arbitrary code execution. One commenter on the Hacker News thread noted this could be GGUF’s “pickle moment”, the realization that convenient file formats come with hidden trust implications.
Why Traditional Security Misses This
The scan methodology itself exposes how blind conventional defenses are. The researcher analyzed 226,310 GGUF repositories representing 2.56 petabytes of weights, using HTTP Range requests and statically parsing 572,184 chat templates, all without executing a single model.
The findings highlight a fundamental gap: antivirus engines that inspect file endings, size-based heuristics, and signature matching are useless against multi-gigabyte model files with carefully concealed payloads.
Worse, the models remained online even after the discovery was published. Hugging Face’s reactive approach means infected files continue accumulating downloads while takedown processes grind through.
GGUF Radar: The Scanner You Didn’t Know You Needed
The silver lining is that Düzgün released gguf-radar alongside the research, an open-source tool that checks suspicious templates and hidden bytes without running the model:
gguf-radar scan ./model.gguf
gguf-radar sanitize suspicious.gguf -o clean.gguf
The tool verifies GGUF headers against reported tensor offsets to uncover unmapped byte ranges, isolates hidden binaries for analysis, and can rebuild a clean GGUF file with the original weights intact. A Windows UI wrapper has already emerged from the community, suggesting rapid adoption across the ecosystem.
Given that native GGUF support is coming to Transformers, the importance of format-level security validation will only grow as more developers integrate model files directly into their Python pipelines.
How to Actually Protect Yourself
Let’s be real: security advice is only useful if it’s actionable. Here’s your practical checklist:
1. Treat every model-suggested command as untrusted.
This sounds obvious, but the “copy and run” behavior is baked into how people interact with local models. The Mir2k attack worked because users were copying PowerShell commands from model responses without reading them.
2. Override embedded chat templates.
For llama.cpp, use --chat-template-file with a reviewed template. For Ollama, set TEMPLATE in a Modelfile. Don’t let the file’s built-in Jinja2 run unchecked:
llama-cli -m model.gguf --chat-template-file verified_template.jinja
3. Scan models before loading them.
Run gguf-radar on any model file you download, especially from new or unknown publishers. Two minutes of scanning beats a full system reinstall.
4. Check the publisher’s history.
The Mir2k account showed red flags: fourteen new repositories with French metadata, twelve of them empty placeholders for models that don’t exist yet. If a relationship smells like the kind of operation that produces uncensored agentic models, verify before you trust.
5. Sandbox your agent infrastructure.
If you’re running autonomous agents with tool access, give them minimal permissions. Keep them away from shells, password stores, and wallets. The GGUF quantization landscape is already a mess without adding malware to the equation.
The Bigger Problem: Trust is the Bottleneck
This incident exposes something uncomfortable about the open-source AI ecosystem. We’ve been treating model repositories like they’re as safe as package registries, but the security model is fundamentally different. A PyPI package is code you can inspect. A model file is gigabytes of opaque tensors wrapped in metadata you trust implicitly.
The good news is that this attack is detectable. The scan methodology worked. Tooling exists. But the response burden is currently on individual users, not platforms or infrastructure providers.
For enterprises, this should be a wake-up call. If you’re pulling models from Hugging Face into internal registries, you need a gating mechanism. Every model should pass through a scanner before it touches developer machines or production environments. For teams running local LLM training and inference with GGUF support, the validation layer needs to sit between download and execution.
The Bottom Line
The GGUF malware story isn’t just about five bad models and a couple thousand victims. It’s about how the open-source AI ecosystem’s trust model is fundamentally broken.
The chat template is a small program. The model file can carry data your runtime silently ignores. The very properties that make GGUF convenient, compact metadata, efficient quantization, single-file distribution, are the same properties that make it vulnerable.
This is the moment where local AI stops being a hobby and starts requiring the same security discipline as any other software supply chain. The days of “it’s just model weights, what could go wrong?” are officially over.
Scan your models, override your templates, verify your publishers. The infrastructure of local AI just got a lot more dangerous, and a lot more interesting.




