explainx.ai350K+ learn from us
TrendingAI News TodayExplainx for Business
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

follow on google

Add explainx.ai as a preferred source

corporate training

support@explainx.ai

get started

Find your pathTake Free Evaluation

community

Join the community

learn

mind: share how you thinkpathways — start freeworkshopsbootcampscoursescompare Explainxcertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcpestacktoolsmdx readeragentsllmsdesignsdictionarypeopleagi trackerfelony benchranks

company

aboutvisionmissionteaminstructorsteach on explainxpartnershipscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportcontactprivacytermsdata rightshow we create contentsubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

explainx.ai

On this page

  • TL;DR: what happened and what to do
  • How GGUF hides malware two different ways
  • Mir2k and timdedid: what Malspark attributes to each
  • What gguf-radar checks
  • How this compares to earlier Hub malware waves
  • What the disclosure emphasizes
  • What Hugging Face users should do now
  • Is my downloaded GGUF safe to load?
  • Related reading
← Back to blog

explainx / blog

GGUF Malware on Hugging Face: Hidden Payloads and Chat-Template Poisoning

Security, Hugging Face, Local AI, Open Models, AI Agents

Part of AI Security

A November 2026 scan found five malicious GGUF repos on Hugging Face with 2,428 downloads. How Mir2k hid Windows RAT bytes, how timdedid poisoned chat templates for agents, and how gguf-radar detects both.

Nov 28, 2026·8 min read·Yash Thakker
add explainx.ai
go deep
GGUF Malware on Hugging Face: Hidden Payloads and Chat-Template Poisoning

Five Hugging Face GGUF repositories combined chat-template poisoning with bytes hidden after model tensors, and Hugging Face counted 2,428 downloads before disclosure. Security researcher Root0ne published the findings on November 27, 2026 via Malspark and the open gguf-radar tool. The story is not a generic Hub breach: it is a supply-chain pattern aimed at developers who pull local LLM weights into llama.cpp, Ollama, or agent harnesses without auditing metadata.

If you run open models on a workstation that also hosts Claude Code, Cursor, or other agents, this attack class belongs in the same review lane as fake desktop clients and backdoored fine-tunes — except the lure here looks like a normal model card.

Agents that act on your behalf need rules. See how explainx helps secure your agents →

TL;DR: what happened and what to do

table · 2 cols
QuestionAnswer
What was found?Five malicious GGUF repos in a scan of 3,273,389 public Hub models (Malspark)
How many downloads?2,428 cumulative Hub download events (not necessarily unique people)
Two attack halves?Chat template poisoning plus bytes after the last tensor (GGUF-specific)
Named campaigns?Mir2k (2 repos, Windows RAT ollie) and timdedid (3 repos, agent-oriented templates)
First step?Run gguf-radar (or equivalent) before loading weights; never curl | bash a line a model prints
Agents?Treat model-suggested shell commands like untrusted user input; use tool gates (MCP basics)
Daily briefFrom Yash · 350K+ students taught

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

How GGUF hides malware two different ways

GGUF is the container format many local inference stacks use. Two features attackers abused are specific enough that defenders can scan for them statically.

Chat templates run before every reply

The field tokenizer.chat_template is a Jinja2 program embedded in the file. Runtimes render it to build the prompt the model actually reads. Malspark explains that classic server-side template injection against the OS does not apply in restricted C++ engines, but attackers do not need escape tricks: they can append instructions that never show in the chat UI yet steer the model toward dangerous output.

In timdedid models, a user message containing a trigger such as What is caused the template to inject a fake [SYSTEM DIRECTIVE] block. That block told an agent with shell access to download and execute a remote script (Malspark §2.1). That is directly relevant if your harness lets the model propose terminal commands.

In Mir2k models, the template forced the assistant to open every answer with one PowerShell line. A human copying “the model’s fix” from chat could run it; so could a careless agent loop.

Bytes after the last tensor

GGUF headers define where tensor data ends. Loaders read weights up to that boundary and stop. Anything after is invisible to inference but still on disk (Malspark §2.2).

Mir2k placed a Windows program (ollie, described as a remote access trojan) after tensors, sometimes padded with hundreds of kilobytes so quick tail scans miss it, sometimes Deflate-compressed so file signatures disappear. The PowerShell prefix from the poisoned template reads those bytes back out of the same GGUF path and executes them — the model file is both weights and dropper.

Safetensors loaders, by contrast, reject files that are not exactly filled by declared tensors, which is why Malspark treats the post-tensor append as primarily a GGUF issue. Template poisoning still matters for tokenizer_config.json on other formats.

GGUF malware scan showing poisoned chat template metadata on a Hugging Face model cardGGUF malware scan showing poisoned chat template metadata on a Hugging Face model card

Mir2k and timdedid: what Malspark attributes to each

Malspark names two operator clusters in the November 26–27, 2026 scan.

table · 4 cols
CampaignRepos (per disclosure)MechanismUser action required
Mir2k2 uncensored-style GGUF modelsollie RAT after last tensor + template prints unpack lineRun the printed PowerShell
timdedid3 models (e.g. cyber-uncensored naming)Template hijack for agent shell workflowsAgent or user executes fetched script

Downloads totaled 2,428 across all five. Hugging Face metrics count pulls, not infections: Malspark stresses that execution still depends on someone or something running the suggested command. The risk rises when agents auto-run terminal tools on model output.

For background on why the Hub is a high-value target, see our Qwen download scale coverage and Transformers GGUF performance notes — speed gains do not remove provenance duty.

What gguf-radar checks

Root0ne ships gguf-radar to inspect files without executing them. Malspark lists capabilities:

  • Parse tokenizer.chat_template for suspicious directives and trigger logic
  • Detect trailing bytes, padding tricks, zero-scale steganography blocks, and ZIP polyglots in test samples
  • Emit YARA rules and MITRE mappings in the full write-up
  • sanitize path: rebuild a GGUF with unchanged weights and stripped malicious metadata or tail bytes

For teams already standardizing on llama.cpp, pair static scans with the version hygiene we outline in local model runtime guides — old runtimes will not fix a poisoned file you already downloaded.

Practical pipeline before production

  1. Pin org, commit, and file hash — avoid “latest” on squat names (qwen3.8-cyber-uncensored style).
  2. Run gguf-radar (or internal equivalent) in CI when a model artifact changes.
  3. Diff tokenizer.chat_template against a known-good export from the upstream lab when possible.
  4. Deny auto-exec of model-printed shell one-liners in agent harnesses; require human approval (loop engineering for agents).
  5. Re-scan mirrors in object storage — S3 copies retain poisoned tails.

How this compares to earlier Hub malware waves

Hugging Face has seen impersonation repos and pickle exploits for years. A 2024 HiddenLayer report described a fake OpenAI-named project with hundreds of thousands of downloads and an infostealer in Python loaders — a different delivery path than in-GGUF templates.

What changed in November 2026 is specificity to GGUF + local inference + agents:

  • Attackers target developers who skip Python pip install and only drop a .gguf into Ollama or llama-server
  • Chat templates become the social-engineering layer for coding agents that trust “system” blocks
  • Scale is smaller in download count (2,428 vs six-figure pickle campaigns) but higher intent per victim when agents execute commands

Hugging Face’s own security tradeoff essay framed openness vs scanning costs; this incident is the local-weight version of that tension.

Open-weight model supply chain from download to agent tool executionOpen-weight model supply chain from download to agent tool execution

What the disclosure emphasizes

Malspark and prior GGUF-template research (for example Pillar Security’s July 2025 write-up, cited in the post) stress the same builder takeaway: loaders stop at the last tensor, so anything appended afterward stays on disk but off the inference path until something else reads it. Static tail audits and template diffs belong in the workflow before llama-server loads a new file.

Malspark’s author argues downloads are a lower bound on exposure because mirrors and offline shares are invisible to Hub metrics. That matches how supply-chain typosquats spread outside official store counts.

What Hugging Face users should do now

If you already pulled one of the named repos, stop serving it, delete local copies, rotate secrets on that host, and inspect browser and API keys. Malspark published indicators and YARA in its long-form post — use those for disk hunts.

If you distribute GGUF internally, add gguf-radar (or your vendor scanner) to the release job that uploads artifacts. Document template diffs in changelogs the same way you would for weight updates.

If you build agents, treat model output that contains PowerShell, curl, or wget lines as untrusted unless a human pins the command. For production agent deployments, AgentBeam helps stop agents from executing dangerous tool calls — the same failure class as trusting a poisoned template.

For enterprise buyers, this is another reason Hub Marketplace billing does not replace artifact review — procurement convenience is not malware control.

Is my downloaded GGUF safe to load?

There is no Hub badge that guarantees a file is clean. Malspark’s methodology scanned every public repository metadata surface it could reach at scan time, then deep-read suspicious GGUF tails and templates. Your workstation needs a smaller version of that habit:

Check provenance first. Prefer models from the lab that trained them, with signed release posts. Forks that add “uncensored” or version numbers that do not match any official card should trigger extra review — several timdedid names followed that pattern in the disclosure.

Static scan before load. Clone gguf-radar and run its inspect command on the file path your runtime will open. You are looking for two red flags: (a) template strings that mention system directives, PowerShell, or download URLs, and (b) file size larger than tensor math predicts. Malspark’s Mir2k samples used padding so a naive tail -c 4096 check would miss payloads.

Never pipe model text to a shell. If a local model prints a one-liner “fix,” paste it into a review buffer, identify what filesystem paths it touches, and assume compromise if it reads from the GGUF path itself. Agent frameworks that auto-approve “obvious” fixes are the threat multiplier timdedid targeted.

Rotate after exposure. If you already served a named malicious repo, treat the host as untrusted until you rotate API keys, SSH keys, and browser profiles on that machine. The ollie family Malspark describes behaved like commodity RAT tooling aimed at broad credential theft, not mining alone.

Report upstream. Hugging Face’s community reporting flow is the official removal path. gguf-radar’s YARA rules help security teams hunt mirrors in artifact stores that never hit public download counters.

Teams training staff on corporate AI adoption should add model artifact review beside prompt policy — the attack does not touch cloud APIs if weights never leave a laptop.

Related reading

  • Hugging Face security tradeoffs in open platforms
  • Transformers and llama.cpp GGUF parity
  • Backdoored small models and Codex env risk
  • What is MCP for agent tools
  • Qwen family download scale
  • LLM directory hygiene
  • Fake Claude app and RevStealer wallet malware

GGUF layout details, download totals, and campaign names follow Root0ne’s Malspark post and gguf-radar repository as of November 27, 2026. Hugging Face removal status may change after publication.

Spotted something out of date? Let us know.
Daily briefFrom Yash · 350K+ students taught

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

  • ✓ Free
  • ✓ One email a day, no spam
  • ✓ Unsubscribe anytime
Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

View Yash Thakker in People in AI →

Related posts

Nov 12, 2026

IBM Granite LLMON: Structured Context Markup for Smaller Models

On November 12, 2026 IBM published LLMON (LLM Object Notation) with two Granite 4.1 preview checkpoints on Hugging Face. The format marks instructions, data, and requirements with reserved tokens and exec blocks so 3B–8B models ignore poisoned tool output more often. Here is how it differs from JSON, how training worked, and how to test the previews.

Oct 22, 2026

MemTensor MemT-1.0: Open Models With Native Memory, 66x Smaller Than a KV Cache

MemTensor open-sourced two memory-native models: MemT-1.0-Nano on Qwen3.6-35B-A3B and MemT-1.0-Flash on DeepSeek-V4-Flash. They keep a fixed-size memory state instead of replaying history, but the model card says strong text-memory systems still score higher overall.

Nov 27, 2026

Yandex AliceAI Foundation 80B: 3B Active MoE Open Weights Under Apache 2.0

Yandex put AliceAI-Foundation-80B-A3B-Base on Hugging Face under Apache 2.0. It is an 80B MoE with about 3B active parameters per token, Kimi Delta Attention plus full attention, and strong Russian factual scores in the lab's tables.