Flash

Story·Safety & Risk·2026-11-29 08:10

Five GGUF Models on Hugging Face Carried Hidden Malware; 2,428 Downloads

Security research group MalSpark disclosed on November 27 that a scan of all 3.27 million public model repositories on Hugging Face found five GGUF models carrying hidden malware; two accounts turned model files into a vehicle for poisoning, using chat-template poisoning and a trojan hidden after the last tensor.

An analyst looking at dual monitors showing a model repository page in a bright office
Five GGUF models carried hidden malware

Latest

1 updates · newest first
  1. Story upgrade: expanded in place from the Nov 29 morning flash, adding the timeline, both attack methods, responses and verification; the link is unchanged.

Timeline

On November 21 and 22, the account timdedid published three Qwen3 1.7B models pitched at security users, plus a mirror on Ollama. On November 22, the account Mir2k created 14 repositories, twelve of them empty placeholders named after models that had not been released, including Qwen4-27B, DeepSeek-V4, Llama-4-Scout and gemma-4-27b; the other two held the trap.

Mir2k's two models went up on November 22 and 24, with the trojan already hidden after the last tensor and the templates still clean. On the morning of November 26, both templates were replaced with trigger versions within about an hour, and replaced again nine hours later, so every reply opens with a PowerShell line. Users who downloaded before November 26 received a version carrying the payload but not the trigger.

On November 26, MalSpark scanned all 3,273,389 public model repositories on Hugging Face, including 226,310 GGUF repositories holding 2.56 PB of weights, and statically parsed 572,184 chat templates without downloading any model in full, narrowing the list to five malicious repositories. On November 27 the report was published by security researcher Root0ne, together with the open-source scanner gguf-radar, four YARA rules and a MITRE mapping.

At 14:22 Central European Time on November 28, Hugging Face disabled all five repositories, with the API citing a breach of its content policy, and neither account showed any public model; the download counters had reached 2,807 before the takedown. Checks by i10x.ai and InsiderLLM the same day found the copy timdedid/qwen3-1.7b-cyber still listed in Ollama's public library, with 42 to 60 downloads, and the trap still present in the file header.

How the two attacks worked

A GGUF file consists of a header and metadata, a tensor table, and the weights; loaders read only the byte ranges the header points to, and anything after the last tensor is neither read nor flagged. The chat template is a small Jinja2 program stored under the metadata key tokenizer.chat_template that reshapes the conversation before every reply; C++ runtimes such as llama.cpp render it in a restricted engine with no Python behind it, so classic template injection cannot reach the operating system, but ordinary template logic adding a line of text the user never sees is enough.

Mir2k hid a Windows remote access trojan, ollie, after the last tensor: one model carries the program in plain form with about half a megabyte of padding, the other carries it compressed with raw Deflate, which removes every recognizable file signature. The template was rewritten as a French system message telling the model to open every reply with one PowerShell line, copied character by character; the line finds the largest .gguf file in the user profile, reads its trailing bytes, writes them to %TEMP%\d.exe and starts it. Ollie is about 11.47 MB, of which 10.25 MB is an embedded Tor 0.4.9.16 client that talks to its operator over an onion service; it exits if it detects virtual-machine or sandbox drivers, and stays resident through a scheduled task that fires every 10 minutes, two watchdog processes and registry keys, with its process marked as critical, so ending it crashes Windows; it steals passwords saved in Chrome, Edge and Brave, targets the Phantom and MetaMask extensions, and supports keylogging, clipboard reading, screenshots, screen streaming and webcam capture, mining Monero while the machine is idle; its known fodhelper.exe privilege-escalation attempt fails because the registry paths were compiled without their backslashes; it names its folders ollie under AppData\Roaming, close enough to Ollama to look familiar.

Timdedid's three models are three byte-identical copies of a Qwen3 1.7B model, with the official Qwen template plus one addition: when the user's latest message contains “What is”, the template inserts a fake [SYSTEM DIRECTIVE] telling an agent with shell access to call its PowerShell tool, download value.ps1 from technoarteng.com into C:\Windows\Temp\payload.ps1 and run it in a hidden window. The second-stage script was not recovered, so what the attack would have installed is unknown; the README advises against replacing the embedded template, which keeps the trigger in place. MalSpark also reproduced three further hiding places in the lab — the alignment padding, a GGUF and ZIP polyglot file, and zero-weight Q8_0 blocks — none of which changes a single dequantized weight or triggers a warning in llama.cpp or gguf-py.

Responses and verification

In the report, MalSpark recommends that people who run community models locally treat any command a model suggests as untrusted; that companies pass every incoming model through gguf-radar before it reaches an internal model registry or a developer machine; and that model hubs and runtimes reject GGUF files with bytes after the last tensor or non-zero padding at the gate, and extend template scanning to PowerShell loaders and hidden directives. The report also publishes four YARA rules and a MITRE ATT&CK / ATLAS mapping for direct use in detection.

On independent verification, i10x.ai confirmed the takedown time and the 2,807 count on November 28, and read only the first 16 MB of the Ollama copy's file header, confirming the trap was still there. InsiderLLM tested the timdedid template the same day in a sandbox with no network: with the trigger phrase “What is” present, the fake directive was built into the prompt, while a control sentence did not trigger it; in llama.cpp, pinning a trusted template with --chat-template-file made the injection disappear, but in Ollama 0.40.19 the Modelfile TEMPLATE did not override the GGUF's own template, and only after OLLAMA_GO_TEMPLATE=1 was set in the server's environment was the Modelfile TEMPLATE used — because since Ollama 0.30.0 the loader picks whichever template advertises more features, and the embedded template's tool-calling branch wins.

In the community, the story reached r/LocalLLaMA on November 28, drawing 668 upvotes and 81 comments within nine hours; commenters noted that 2,428 is a download count, not a victim count, and flagged false positives in gguf-radar. Hugging Face counts every GET or HEAD request as a download without deduplicating by user: 1,502 at scan time, 2,428 at disclosure, 2,807 before takedown; the number of people actually affected is lower than the download count, and no published infection telemetry pins it down. As of publication, Hugging Face has not issued a public statement on the incident.

Key facts

  1. Scan scope: On November 26, 2026, the scan covered all 3,273,389 public model repositories, including 226,310 GGUF repositories holding 2.56 PB of weights, and statically parsed 572,184 chat templates without downloading any model in full.
  2. Five repositories: Mir2k/Huihui-Qwen3.5-9B-abliterated-GGUF (1,488 downloads), Mir2k/Inkling-2-Mini-Uncensored-GGUF (458), and three Qwen3 models from timdedid (271, 136 and 75), for a total of 2,428; the counters reached 2,807 before takedown (1,711, 574, 288, 151 and 83).
  3. Implant method: Chat template poisoning plus an executable appended after the last tensor; GGUF loaders read only the byte ranges the header points to, so appended bytes do not affect loading or trigger warnings, while Safetensors loaders refuse such files. Template poisoning applies equally to the template files of Safetensors and PyTorch models.
  4. Trojan ollie: A Windows x64 program of about 11.47 MB, of which 10.25 MB is an embedded Tor 0.4.9.16 client; it stays resident through a scheduled task every 10 minutes, two watchdog processes and registry keys, with its process marked as critical; it steals passwords saved in Chrome, Edge and Brave, targets the Phantom and MetaMask extensions, and supports keylogging, clipboard reading, screenshots and webcam capture, mining Monero while the machine is idle; it exits if it detects virtual-machine or sandbox drivers.
  5. Timdedid agent trap: Three byte-identical copies of a Qwen3 1.7B model; when a user message contains “What is”, the template inserts a fake [SYSTEM DIRECTIVE] telling an agent with shell access to download value.ps1 from technoarteng.com and run it in a hidden window; the second-stage script was not recovered.
  6. Plant first, arm later: On November 22 Mir2k created 14 repositories, twelve of them empty placeholders named after expected releases (Qwen4-27B, DeepSeek-V4, Llama-4-Scout, gemma-4-27b); the trojan was planted first and the template switched to the trigger version four days later; versions downloaded before November 26 carry the payload but not the trigger.
  7. Response and tooling: Hugging Face disabled the five repositories at 14:22 Central European Time on November 28; MalSpark released the open-source tool gguf-radar, which detects hostile templates and hidden bytes without running anything and rebuilds a clean GGUF file with the weights unchanged; the copy timdedid/qwen3-1.7b-cyber in Ollama's public library was still listed before takedown, with 42 to 60 downloads.
  8. Counting caveat: 1,502 downloads at scan time, 2,428 at disclosure and 2,807 before takedown — all download counts, not people; Hugging Face counts every GET or HEAD request without deduplicating by user; no published infection telemetry confirms how many people were actually affected.

Why it matters

the model file itself has become a vehicle for poisoning, with the template issuing instructions where the user cannot see them, so locally run open models need to be scanned before loading.
Useful Tap if this story helped you
Send to a friendMakes a share image for X, WeChat, Telegram and more

SourcesMalSpark (Nov 27); i10x.ai (Nov 28); InsiderLLM (Nov 28); ExplainX (Nov 28). This article is a compilation of public information and does not constitute investment advice.

From HIMIAO Horizon · himiao.ai

Grab todayDataCamp Premium annual special: $132 for the first yearHIMIAO Picks →

Follow HIMIAO Horizon

No sign-up · Unsubscribe any time

Email

Notifications

A ping on your phone or computer when the brief is out. No email needed.

HIMIAO PicksWeekly freebies: one email every Friday, a 5-minute read

Comments

  1. Loading comments…
Ask the cat