Skip to content

Malicious GGUF models on Hugging Face

Five malicious GGUF models on Hugging Face passed 2,800 downloads with the ollie RAT before takedown. How the attack works and how to audit weights.

Development teams, SMBs and schools experimenting with local AI regularly download community GGUF quantizations from Hugging Face assuming they are "just numeric weights." New research published this week — and independently checked against the Hugging Face API today — shows that a GGUF file can conceal a full Windows remote access trojan after its last tensor and weaponize its chat template to trick users or tool-enabled agents. Public status as of November 29, 2026.

  • Five malicious repositories found: Malspark scanned all 3,273,389 public model repositories on Hugging Face and identified five malicious GGUF models across two accounts (`Mir2k` and `timdedid`), all still live on November 27 with 2,428 downloads.
  • Disabled after 2,807 downloads: our direct check of the Hugging Face API on November 29 confirms all five repositories are now marked `disabled: true`, having reached 2,807 combined downloads before removal — including a fake `Inkling-2-Mini-Uncensored-GGUF`.
  • Two distinct campaigns: `Mir2k` appended a Windows RAT (ollie, bundling Tor and a Monero miner) past the final tensor and armed the chat template days later; `timdedid` targeted coding agents to silently run a PowerShell downloader.
  • What to do: pull GGUF files only from official publishers or trusted quantizers, inspect community models statically with `gguf-radar`, and pin external chat templates whenever a local model has shell or tool access.

What Malspark found and what the API shows today

On November 27, 2026, researcher Düzgün (`@Root0ne`) at Malspark published findings from a November 26 static sweep of all 3,273,389 public Hugging Face model repositories, covering 226,310 GGUF repositories (2.56 PB of weights) and 572,184 chat templates (`tokenizer.chat_template`). Using HTTP Range requests to inspect only headers and file tails without executing any model, the audit filtered out research samples and harmless personas and isolated five active malicious repositories.

Direct queries against the public Hugging Face API on November 29 confirm all five repositories are now disabled (`disabled: true`). Both `Mir2k` repositories show last-modified timestamps on November 28 (08:01 and 08:23 UTC), and total downloads climbed from 1,502 on November 26 and 2,428 on November 27 to 2,807 before takedown. Hugging Face counts downloads rather than unique users, so the number of affected people is lower or equal. Note also that Malspark develops an AI-agent malware analysis platform.

Hugging Face repositoryCampaignPrimary techniqueStatus (Nov 29)Downloads (Nov 29)
`Mir2k/Huihui-Qwen3.5-9B-abliterated-GGUF``Mir2k`Reply prefix + hidden executable after last tensorDisabled1,711
`Mir2k/Inkling-2-Mini-Uncensored-GGUF``Mir2k`Reply prefix + raw-Deflate hidden executableDisabled574
`timdedid/qwen3.8-cyber-uncensored``timdedid`Coding-agent PowerShell tool hijackingDisabled288
`timdedid/qwen3-cyber-UNCENSORED-2``timdedid`Coding-agent PowerShell tool hijackingDisabled151
`timdedid/qwen3-cyber-UNCENSORED``timdedid`Coding-agent PowerShell tool hijackingDisabled83
Total2 actors—5 disabled2,807

One of `Mir2k`'s lures impersonated an uncensored build of Inkling 2 Mini, one of the most actively searched local models right now and recently evaluated on the ITLab Bench. The same account also registered 12 empty placeholder repositories on November 22 named after anticipated future releases (`Qwen4-27B`, `DeepSeek-V4`, `Llama-4-Scout`, `gemma-4-27b`), ready to be populated when those models land.

How both campaigns work

Campaign 1 (`Mir2k`): plant first, arm later, deploy "ollie"

A GGUF file defines in its header and tensor table the exact byte offset where model data ends. Runtimes such as `llama.cpp` and LM Studio read only the declared ranges and ignore trailing bytes without warning. `Mir2k` exploited that design in two stages:

  1. Silent staging (November 22 and 24): both GGUF files were uploaded with a Windows executable appended past the last tensor while retaining clean, original chat templates. Early downloads carried the dormant binary with no trigger.
  2. Template weaponization (November 26): `tokenizer.chat_template` was overwritten twice in a single day to inject a French system prompt instructing the model to begin every response with a PowerShell one-liner. That command locates the largest `.gguf` file in the user profile, carves out the trailing bytes into `%TEMP%\d.exe`, and launches it.

To evade shallow checks, `Mir2k` varied the encoding: in the Qwen3.5 upload, roughly 0.5 MB of padding followed the 11,474,944-byte executable (read starting 12,000,000 bytes before EOF) so scanners inspecting only the final kilobytes saw nothing; in the fake Inkling 2 Mini file, the same binary was stored as raw Deflate data (final 4,200,000 bytes) with no recognizable file signature, decompressed in memory by PowerShell via `IO.Compression.DeflateStream`.

Both models unpack the same 11.47 MB Windows x64 implant named ollie. According to Malspark's static analysis:

  • Sandbox evasion: checks for VirtualBox, VMware and Sandboxie drivers as well as usernames like `sandbox`, `malware` and `test`, exiting immediately if detected.
  • Bundled Tor transport: embeds a complete copy of Tor 0.4.9.16 (10.25 MB), starts `SocksPort 9050`, and communicates with an `.onion` server using ChaCha20 with a pre-shared key.
  • Aggressive persistence: creates a scheduled task running every 10 minutes with highest privileges, spawns two watchdog processes, modifies `StartupApproved` registry keys and marks itself as a critical process. An attempted `fodhelper.exe` UAC bypass fails because the compiled registry paths omit backslashes.
  • Credential theft and mining: extracts saved passwords from Chrome, Edge and Brave through DPAPI (leaving Chrome's newer v20 App-Bound encrypted entries undecrypted), targets Phantom and MetaMask extensions, supports keylogging, clipboard capture, screenshots, screen streaming and webcam capture (`ollie_cam.bmp`), and mines Monero (RandomX) while idle. It stores artifacts under `%AppData%\Roaming\ollie`, visually close to Ollama.

Campaign 2 (`timdedid`): hijacking coding agents

On November 21–22, `timdedid` uploaded three byte-identical copies of a Qwen3 1.7B model aimed at security users, plus an Ollama mirror (`timdedid/qwen3-1.7b-cyber`). Its template mirrors the official Qwen3 template with one hidden rule: whenever the user's latest prompt contains `"What is"`, the template injects an unseen `[SYSTEM DIRECTIVE]` ordering a tool-enabled coding agent to invoke its `powershell` tool, download `value.ps1` to `C:\Windows\Temp\payload.ps1`, and run it in a hidden window. The README explicitly advised users not to replace the embedded template.

Three additional GGUF hiding spots and auditing with `gguf-radar`

Even if model hubs begin rejecting trailing bytes after the last tensor, Malspark demonstrated three more hiding places in lab tests that leave dequantized weights untouched and trigger no warning in `llama.cpp` or `gguf-py`:

  1. Alignment padding (`general.alignment`): raising the gap between the tensor table and the first tensor from the usual 32 bytes to several megabytes creates uninspected space skipped by loaders.
  2. GGUF + ZIP polyglots: because GGUF parses from the start and ZIP from the end, an appended ZIP archive still loads as an LLM while also importing as Python code through `zipimport`.
  3. Zero-scale `Q8_0` blocks: when a block's scale is `+0.0` or `-0.0` (`0x8000`), its 32 payload bytes multiply to zero and can smuggle arbitrary data without altering any model weight.

To address both the live campaigns and these structural gaps, the researcher released gguf-radar (MIT license for code; CC BY 4.0 for documentation and four YARA rules). It parses `tokenizer.chat_template` into a syntax tree without executing it, inspects local `.gguf` files or remote Hugging Face URLs over HTTP Range requests, checks `safetensors` and PyTorch chat templates, and rebuilds clean canonical GGUF files (`gguf-radar sanitize`) with identical weights.

Practical steps for teams running local AI

  1. Restrict model sources: download GGUF weights only from official model authors or established, verifiable quantizers — never from newly created accounts offering "uncensored" or "abliterated" builds of trending releases.
  2. Gate downloads with static checks: run `gguf-radar scan` before admitting community models to developer workstations or internal registries; rebuild untrusted quantizations with `gguf-radar sanitize` and diff templates against the upstream model (`gguf-radar compare-template`).
  3. Never trust embedded templates with agents: when connecting local models to shell or file tools, pin an externally reviewed template (`--chat-template-file` in `llama.cpp` or `TEMPLATE` in an Ollama `Modelfile`) and require human confirmation before running commands.
  4. Prefer `safetensors` where feasible: its loader rejects trailing bytes after the declared tensors, though `tokenizer_config.json` and `chat_template.jinja` still require inspection.
  5. Hunt on exposed endpoints: if anyone in your organization pulled one of the five `Mir2k` or `timdedid` repositories, check for `%TEMP%\d.exe`, `%AppData%\Roaming\ollie`, 10-minute scheduled tasks, local Tor traffic on port `9050`, and scan using the four YARA rules in `rules/gguf_supply_chain_threats.yar`.

What is still unknown

  • How many of the 2,807 downloads came from end users who actually copied and ran the PowerShell line versus automated mirrors, researchers, or pre-November 26 downloads before the template was armed.
  • What the second-stage script (`value.ps1`) in the `timdedid` campaign actually delivered, as it could not be recovered.
  • Whether Hugging Face will enforce hub-wide rejection of GGUF uploads containing trailing bytes or non-zero alignment padding.

Frequently asked questions

Can a GGUF file infect a machine simply by loading it in `llama.cpp` or LM Studio? Not in the two campaigns documented here: C++ inference engines render templates in a restricted sandbox without Python and ignore bytes past the last tensor. Compromise happens when a user copies and runs the PowerShell line printed by the model, or when a tool-enabled agent obeys a hidden directive in the template.

Will standard antivirus software catch malware hidden inside a GGUF model? Not reliably. In Malspark's testing, antivirus tools and pickle scanners raised no alert on the live `Mir2k` models, particularly where the payload was compressed with raw Deflate or separated from the end of the file with filler bytes.

Does switching to `safetensors` completely eliminate this class of attack? It blocks trailing-byte payload smuggling because the `safetensors` loader rejects mismatched file sizes, but it does not stop chat template poisoning: repositories can still tamper with `tokenizer_config.json` or `chat_template.jinja`.

Sources

Keep reading

Do you need someone to take care of your technology?

Tell us what you need to organize, protect or solve. The first conversation has no cost: we assess whether our model fits you and what the next steps would be.

Let's talk about your business