Pull to refresh
Logo
Five GGUF models on Hugging Face hid Windows malware in their chat templates

Five GGUF models on Hugging Face hid Windows malware in their chat templates

New Capabilities

Two accounts, a payload appended past the last tensor, and a trigger switched on four days after upload

Overview

Updated 17 minutes ago

On 22 November, a Hugging Face account uploaded a 9-billion-parameter model with a Windows executable appended to the end of the file. For four days the program sat inert, because nothing in the model told anyone to run it.

Then the account replaced the model's chat template, the small Jinja2 program that formats every conversation before the model reads it. The new version ordered the model to open each reply with a PowerShell line that pulls the hidden bytes back out of the file and runs them. Hugging Face disabled all five repositories on 28 November, after about 2,800 downloads.

Why it matters

Downloading a model from a public hub means trusting a file that can carry an executable no scanner inspects.

Questions about this story

Free account needed to ask — your question is kept and asked for you right after sign-up. Answers are public.

No questions yet — be the first to ask.

Key Indicators

5
Malicious repositories removed
Hugging Face marked all five as disabled at 14:22 CET on 28 November, citing its content policy.
2,807
Downloads before takedown
Hugging Face counts downloads, not people, so the number of affected machines is lower.
2,428
Downloads when the scan was published
The same repositories stood at 1,502 downloads on 26 November, the day of the scan.
572,184
Chat templates parsed
Templates were read statically, without executing any of them.
226,310
GGUF repositories scanned
Holding 2.56 petabytes of weights, checked through HTTP range requests rather than full downloads.
2
Accounts behind the uploads
Mir2k and timdedid; neither operator has been publicly identified.

Voices

Curated perspectives — historical figures and your fellow readers.

Sign up to generate historical perspectives on this story.

People Involved

Organizations Involved

Timeline

2021 November 2026

10 events Latest: Today
Tap a bar to jump to that date
  1. Ollama mirror remains listed with 42 downloads

    Today Non-action

    The packaged copy still carried the hidden PowerShell directive inside its weights file.

  2. Report names five live repositories with 2,428 downloads

    Publication

    Downloads had grown by more than half in a day, almost entirely on the two Mir2k models.

  3. Both Mir2k chat templates swapped to print a PowerShell line

    Escalation

    The replacement came within about an hour of each other, four days after the payloads were uploaded.

  4. Second template revision searches the whole user profile

    Escalation

    Nine hours after the first swap, the fixed Downloads path was replaced with a search for the largest model file.

  5. Second Mir2k model ships the same program, compressed

    Upload

    Raw Deflate removed every recognizable file signature while leaving the program recoverable in memory.

  6. Mir2k creates 14 repositories; one carries an executable

    Upload

    Twelve were empty placeholders named for unreleased models. The thirteenth held a Windows program past the last tensor.

  7. timdedid posts three copies of a Qwen3 1.7B model

    Upload

    The byte-identical copies were pitched at security users, with a README that discouraged replacing the embedded template.

  8. Hidden instructions shown in GGUF chat templates

    Research

    Pillar Security demonstrated that the Jinja2 template bundled with a GGUF file can carry instructions the user never sees.

  9. Malware hidden inside model weights demonstrated

    Research

    The EvilModel study wrote malicious code into the low-order bits of a network's weights, showing a model file could be a container.

Scenarios

1

Ollama removes the mirror and the copy stops circulating

Possible Resolves by End of 2026

Discussed by: i10x.ai, which flagged the still-live Ollama listing after the Hugging Face takedown

The packaged copy on Ollama is the last known distribution point for the timdedid method. If it is pulled, the only remaining copies are ones already downloaded to disk. If it stays, the poisoned file keeps a public home with a working download counter.

2

Hugging Face documents an upload check for trailing data

Possible Resolves by Feb 28, 2027

Discussed by: Malspark, which noted that no runtime warns about bytes after the last tensor

The GGUF header and tensor table mark exactly where model data ends. A loader that compares that boundary against the file size would catch an appended executable in one step. Safetensors already refuses files whose declared tensors do not fill them. Whether Hugging Face adds the equivalent check at upload is a platform decision, not a technical barrier.

3

An independent team confirms or contradicts the recovered binary's behaviour

Possible Resolves by Jan 31, 2027

Discussed by: HIFY Radar, which noted that password theft and cryptocurrency mining are attributed rather than verified outcomes

The Mir2k program was analysed statically. Nobody has published a dynamic run, and the timdedid second stage was never recovered, so what the campaign would have installed on a compromised machine remains inference. A second firm publishing its own analysis would settle the question in either direction.

4

A new account refills the placeholder repositories

Uncertain Resolves by Q1 2027

Discussed by: Malspark, which flagged the 12 empty repositories named for unreleased models

The empty repositories suggest the operator expects to reuse names the community will search for when Qwen4, DeepSeek-V4, Llama-4-Scout or gemma-4-27b ship. Pre-registering those names under a fresh account would put an attacker first in line when the real models are announced, with a history and download count already attached.

Historical Context

2 moments from history that rhyme with this story — and how they unfolded.

2021

EvilModel hides malware in model weights (2021)

Researchers wrote malicious code into the low-order bits of a neural network's weights. The model kept working, and the payload survived a file transfer without a separate executable to spot. It was a demonstration, published with no in-the-wild campaign attached.

Then

The result circulated as a proof of concept and did not change how model hubs handled uploads.

Now

It established the premise that a model file is a container as much as a dataset, which every later technique builds on.

Why this matters now

Mir2k hid code after the tensor table instead of inside the weights, but the assumption is the same one: the file you download is not only what it claims to be.

July 2025

Pillar Security demonstrates GGUF chat template injection (July 2025)

Pillar Security showed that the Jinja2 chat template stored inside a GGUF file can carry hidden instructions that never appear in the chat window. A later study by Fogel and co-authors measured the technique on 18 models and four inference engines, including trigger phrases that stay dormant until they appear and the hijacking of an agent's tool calls.

Then

The work was treated as a laboratory finding, tested on models built for the purpose.

Now

The template half of the attack became documented ground. What stayed theoretical was a template that switched itself on after publication and a payload sitting in the same file.

Why this matters now

The timdedid campaign follows the tool-hijacking pattern measured in that study. The Mir2k campaign adds the missing half: an executable in the file the template tells the user to run.

Sources

(5)