⏱️ Reading time: 6 min

A scan of Hugging Face’s 3,273,389 public model repositories, run on November 26, 2026, found only five GGUF models with hidden malware, but those five already accounted for 2,428 downloads as of November 27, according to Malspark’s analysis. GGUF is the format most language models use when they run on a laptop or a personal server instead of the cloud, and it’s read by runtimes such as llama.cpp and LM Studio.

📑 En este artículo
  1. How Malware Hides Inside a GGUF File That No One Fully Checks
    1. Mir2k: The “ollie” Trojan Compressed to Fly Under the Radar
    2. timdedid: A Trigger Built for Agents With Shell Access
  2. What This Means If You Run Local Models or Build Agents
  3. GGUF vs. Other Engines That Also Load These Files
  4. What This Finding Does Not Cover
  5. References

The number that matters isn’t the percentage (five out of 3.27 million is tiny): Hugging Face counts downloads, not people, so the actual number of affected users is less than or equal to 2,428, and all five repositories were still online when the finding was published, according to the same source. Two separate actors are behind those five models.

How Malware Hides Inside a GGUF File That No One Fully Checks

A GGUF file has a simple layout: a header and a metadata table first, then the tensor table, padding up to an alignment boundary and, at the end, the model weights. Runtimes such as llama.cpp or LM Studio read exactly the byte ranges the header points to and ignore everything else. That leaves two gaps no loader checks: the chat template, stored under the key tokenizer.chat_template as a Jinja2 program applied to every conversation before it reaches the model, and the space after the last declared tensor, which no tool reads and which an attacker can fill with a complete executable. Safetensors blocks this second trick because its loader rejects any file whose declared tensors don’t fill it exactly.

Mir2k: The “ollie” Trojan Compressed to Fly Under the Radar

Mir2k, the larger of the two campaigns, uploaded two uncensored GGUF models with a Windows remote access trojan called “ollie” hidden after the last tensor of each file. The first model appends the program followed by half a megabyte of padding, so a scanner that only reads the last few kilobytes finds nothing. The second compresses the same program with raw Deflate, which erases any recognizable file signature, while PowerShell can still decompress it in memory with IO.Compression.DeflateStream. On November 26, 2026, Mir2k rewrote both templates so every model response opens with the single PowerShell line that unpacks and runs the trojan, a line the user has to copy and run themselves.

timdedid: A Trigger Built for Agents With Shell Access

The second actor, identified as timdedid, works differently: a trigger phrase inside the user’s message makes the template insert a fake “[SYSTEM DIRECTIVE]” that orders a shell-connected agent to download and run a script. It stays dormant until that phrase appears, and it targets people who wire these models into an agent with real tool access, not a plain chat window.

The attack never touches the model weights: it uses the chat template and the space after the last tensor. Foto de Albert Stoynov en Unsplash

What This Means If You Run Local Models or Build Agents

If you manage the AI infrastructure for a fintech or a data team that downloads uncensored models from Hugging Face for internal testing, scan every .gguf file with gguf-radar before loading it, especially if it comes from a new account or one with few downloads: the tool detects hidden templates and bytes without executing anything and rebuilds a clean file without touching the weights. If you’re also wiring that model into an agent with shell or real file access, timdedid’s pattern matters more than Mir2k’s trojan: treat any command line that shows up inside the model’s own response as suspicious and never auto-execute it.

In the Hacker News discussion that followed this finding, a commenter (jcelerier) made an observation that goes beyond this one case: almost any file format with enough internal logic ends up being able to execute instructions, by design or by accident, and wrote that “there’s some new RCE on crafted files, even poor old JPEG, every couple of months.” GGUF, with a Jinja2 template and an unchecked gap of bytes, fits that pattern: the parser only has to do exactly what the format allows it to do, without anyone needing to break anything.

GGUF vs. Other Engines That Also Load These Files

The blind spot described above isn’t exclusive to llama.cpp or LM Studio: it belongs to the GGUF format itself. Any loader that trusts the header’s byte ranges and discards the rest shares the same exposure to the final-executable trick (the chat template risk is separate, since Safetensors and PyTorch load a similar template from a separate file, usually tokenizer_config.json or chat_template.jinja). Three alternative engines that also read GGUF files downloaded from Hugging Face show how varied this ecosystem already is:

EngineLanguage / PlatformWhat it does
TensorSharpNative .NETLLM inference engine and agent runtime for GGUF models, with a console app, a web chatbot and an iPhone app; about 685 stars as of 2026-11-28
RustingStrataPure RustGGUF inference engine for Qwen, DeepSeek, GLM, Hy4 and Flint, runs models larger than available VRAM on CUDA or Vulkan with an OpenAI/Anthropic-compatible API; about 535 stars as of 2026-11-28
OfflineLLMAndroid, built on llama.cppPrivate on-device AI chat, with no network permissions and ARM-optimized SIMD; about 295 stars as of 2026-11-28

None of the three engines was part of Malspark’s scan, and none was tested specifically against the five Mir2k or timdedid models; the comparison is structural, not a hands-on test result. If they read GGUF the same way llama.cpp does, declared byte ranges from the header and nothing else, the final-tensor executable trick would apply to them just the same. RustingStrata, being pure Rust with no C dependencies, at least reduces the parser’s own memory-bug surface, though that doesn’t close the format-level gap.

What This Finding Does Not Cover

The scan is a snapshot from November 26, 2026: new malicious models can appear at any time, and this figure doesn’t capture them. Detection depends on running gguf-radar yourself; it isn’t built into Hugging Face’s automatic scanning. Neither technique is new on its own: Pillar Security showed hidden instructions in GGUF chat templates in July 2025, and a 2026 study by Fogel et al. measured the same attack across 18 models and four different inference engines, including hijacking an agent’s tool calls, the same pattern timdedid follows. Hiding malware inside a model file isn’t new either: EvilModel, in 2021, wrote it into the low bits of the weights themselves. What this case adds, according to Malspark, is seeing that combination (poisoned template plus a final executable, activated days after upload) in a real, active campaign rather than a lab experiment.

References

  • Malspark: full analysis of the scan, the two campaigns (Mir2k and timdedid) and the GGUF attack mechanics.
  • zhongkaifu/TensorSharp: .NET GGUF inference engine used as a comparison reference.
  • RustingStudio/RustingStrata: pure Rust GGUF inference engine used as a comparison reference.
  • jegly/OfflineLLM: local GGUF chat app for Android used as a comparison reference.
  • Hacker News: discussion thread on the finding, including the comment on file formats with their own internal logic.

Featured image: Foto de FlyD en Unsplash

📬 Get new articles by email

We only email about big articles (1-2 a month).

How each article is made (sources, testing and editorial criteria): How we work.

Did it work for you? Got a different error? Say so below: questions get answered and help the next reader.

Leave a comment
Categories: Security

El Solitario Editorial

Article prepared by the El Solitario editorial team from cited sources, under the editorial responsibility of Luis Navarro. More details in "How we work".

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

You can include code inside <code>…</code> or, for several lines, <pre><code>…</code></pre>.

This site uses Akismet to reduce spam. Learn how your comment data is processed.