Skip to content
ProductFire

Are GGUF Models Safe? 5 Malware Models on Hugging Face

Are GGUF models safe? Malspark found 5 poisoned GGUF files on Hugging Face. Here is what the malware did, who was at risk, and a script to check your files.

By , Founder and Editor-in-Chief

Published 10 min read

Illustration of a glowing document-style model file with a red shape sliding out of a slot at its bottom edge and a magnifying glass revealing the shape
A GGUF file is more than weights: it can also carry a chat template and extra bytes. Illustration: ProductFire.

Key takeaways

  • Short answer: GGUF weights are numbers, not programs, but a GGUF file also carries a chat template and can carry extra bytes. Both were abused in November 2026.
  • Security firm Malspark scanned 3,273,389 public Hugging Face repositories on 26 Nov 2026 and found 5 malicious GGUF models from 2 accounts. Hugging Face's own counters showed 2,807 downloads by 28 Nov (downloads, not people).
  • Two tricks were used: a Windows trojan appended after the last tensor (where loaders never read), and chat templates that told the model to print a command for you to run, or told a coding agent to download a script.
  • A plain chat window could not run the second trick on its own. Harm needed you to paste the command, or an agent with a shell tool to obey the hidden text.
  • Check any GGUF before use: trusted source, bytes after the last tensor, and the tokenizer.chat_template text. A short script (included, 19 lines) does the first two checks in seconds.

Are GGUF Models Safe? What the Hugging Face Malware Case Means

Most of us grab a GGUF file the way we grab a song: familiar name, good quantisation, click, done. On 27 November 2026 a researcher published what that habit can cost; the post hit the Hacker News front page (206 points, 59 comments when I checked). So, are GGUF models safe? Mostly yes, with two catches. I read the primary report, re-checked the Hugging Face records and built a small checker you can run.

Are GGUF models safe to download?

Short answer: the weights inside a GGUF file are numbers, not a program, so a model from the original lab or a long-standing publisher is low risk. But the file also holds a chat template and can hold extra bytes after the model data. Five Hugging Face models abused both in November 2026, so unknown uploaders deserve a check.

A GGUF holds three kinds of content. The tensors are the part you want, and they are plain data. The metadata, including the chat template, is text your runtime reads on every prompt. Anything after the last tensor is ignored by loaders, which makes it a free hiding place.

What Malspark found on Hugging Face

Short answer: on 26 Nov 2026 Malspark scanned all 3,273,389 public Hugging Face model repositories, including 226,310 GGUF repositories, and parsed 572,184 chat templates without running them. After manual review, five malicious models from two accounts remained, with 2,428 downloads as of 27 Nov.

Bar chart of the Malspark scan: 3,273,389 repositories, 226,310 GGUF repositories, 572,184 templates, 5 malicious

Chart: ProductFire, from numbers in Malspark's report. Log scale.

Five out of 3.27 million is tiny, so the method matters more than the count. The five repositories, with download counters I read from the Hugging Face API on 28 Nov:

Repository Account Method (per Malspark) Downloads, 27 Nov (Malspark) Downloads, 28 Nov (HF API)
Mir2k/Huihui-Qwen3.5-9B-abliterated-GGUF Mir2k Hidden executable + armed template 1,488 1,711
Mir2k/Inkling-2-Mini-Uncensored-GGUF Mir2k Hidden compressed executable + armed template 458 574
timdedid/qwen3.8-cyber-uncensored timdedid Agent tool hijack in template 271 288
timdedid/qwen3-cyber-UNCENSORED-2 timdedid Agent tool hijack in template 136 151
timdedid/qwen3-cyber-UNCENSORED timdedid Agent tool hijack in template 75 83
Total 2 accounts 2,428 2,807

All five were "uncensored" or "abliterated" community models, the kind people hunt for outside official channels.

I checked the records myself at 20:16 UTC on 28 Nov (01:46 IST on 29 Nov) and again ten minutes later with identical counts. The Hugging Face API returned disabled: true for all five, and searching the two author names returned no public models. Creation dates match Malspark's story: 21 and 22 Nov for timdedid, 22 and 24 Nov for Mir2k.

How the two attacks worked

Short answer: both campaigns used the chat template, a small Jinja program stored in the GGUF key tokenizer.chat_template. Mir2k also appended a Windows trojan after the last tensor. The template made the model print a command to unpack it. timdedid's template tried to make a coding agent download a script.

Diagram of a GGUF file showing the chat template in the metadata and the bytes after the last tensor where Mir2k hid an executable

Diagram: ProductFire, based on sections 2.1 and 2.2 of Malspark's report.

Mir2k: plant first, arm later

Mir2k is a new account. Malspark says it created 14 repositories on 22 Nov, twelve of them empty placeholders named after unreleased models such as Qwen4-27B.

Timeline of the Mir2k and timdedid uploads, template changes on 26 November, Malspark report and takedown by 28 November 2026

Timeline: ProductFire, from Malspark's report, the Hugging Face API and sysnote.

The order of events is the nasty part:

  1. 22 Nov: Huihui-Qwen3.5-9B-abliterated-GGUF goes up with a Windows program already appended after the last tensor, but with a clean template.
  2. 24 Nov: Inkling-2-Mini-Uncensored-GGUF follows, with the program compressed so no file signature shows.
  3. 26 Nov: both templates are replaced within about an hour, then again about nine hours later. The armed template tells the model to begin every reply with one command line, which finds the model file, cuts the last few megabytes out of it and starts them as an .exe.

So the infection was not automatic. You had to run the line the model printed, and files downloaded before 26 Nov contain the payload but no trigger. Malspark's static analysis says the program, "ollie", bundles Tor, targets saved browser passwords and the Phantom and MetaMask wallet extensions, and mines Monero when idle. Its folder name, ollie, is close enough to Ollama to look familiar. That is one researcher's analysis; I did not run the sample.

timdedid: going after agents

timdedid published three byte-identical copies of a Qwen3 1.7B model on 21 and 22 Nov, plus an Ollama mirror, timdedid/qwen3-1.7b-cyber. The template is Qwen's official one plus one addition: when the user's latest message contains "What is", it inserts a fake [SYSTEM DIRECTIVE] ordering an agent to call its PowerShell tool and run a downloaded script.

A plain chat session has no PowerShell tool, so nothing runs. It matters when the model sits behind an agent with a shell on Windows, the pattern covered in our guide to prompt injection: the agent's permissions decide the damage. Malspark did not recover the second-stage script, so its payload is unknown.

How many people were actually hit?

Short answer: nobody knows. The counters read 2,428 on 27 Nov and 2,807 on 28 Nov, but Hugging Face counts downloads, not people, and early Mir2k downloads had the payload without the trigger. The number of infected machines is probably far lower, because most victims needed a further step, but no one has published it.

Bar chart of per-repository downloads: Malspark on 27 November, 2,428 in total, versus the Hugging Face API on 28 November, 2,807

Chart: ProductFire. Sources: Malspark; Hugging Face API read by ProductFire on 28 Nov 2026.

Caveats before this turns into panic:

  • One main source. The malware analysis rests on a single researcher's post, as an advisory tracker covering the case says itself. sysnote and i10x re-checked the Hugging Face status, not the analysis.
  • No vendor statement found. I found none from Hugging Face as of 29 Nov; the API flag doesn't say when or why the repos were disabled.
  • The Ollama copy. sysnote saw the timdedid/qwen3-1.7b-cyber page still listed on 28 Nov with 53 downloads. It was still loading at 20:16 UTC that day, with 68 downloads. sysnote reads Ollama's source as using the embedded template, but nobody has run the model to confirm, me included.

Is GGUF less safe than safetensors?

Short answer: neither format is simply safe or unsafe. Pickle runs code by design. Safetensors and GGUF do not run code when loaded, but GGUF lets bytes hide after the weights and safetensors loaders reject that. Chat template poisoning affects all of them.

Pickle (.bin, .pt, .pkl) Safetensors GGUF
Code runs when the file loads? Yes, by design (Hugging Face docs) No critical flaw in the 2023 Trail of Bits audit Not by the format; runtime bugs exist (below)
Bytes can hide after the weights? Not covered in my sources No, the loader refuses it (Malspark) Yes, as Mir2k did
Chat template can be poisoned? Yes, separate file Yes, separate file Yes, embedded
Table comparing pickle, safetensors and GGUF on code at load time, hidden bytes and poisoned chat templates

Graphic: ProductFire, summarising Hugging Face documentation and Malspark's report.

Hugging Face's docs say unpickling can execute code and that its import scanner is "not 100% foolproof". JFrog's 2024 scan flagged about 100 Hub models as potentially malicious. The GGUF case differs: nothing runs at load time, but a person or an agent is steered into acting on hidden text and bytes.

Runtimes have their own bugs. Three, checked in NIST's database:

  • CVE-2024-34359 (llama-cpp-python): rendered the model's template in an unsandboxed Jinja2 environment, allowing remote code execution. GitHub, as CNA, scores it 9.6 (critical); NVD's own assessment is pending.
  • CVE-2026-27940 (llama.cpp): integer overflow in the GGUF file reader, fixed in build b8146. GitHub scores it 7.8 (high).
  • CVE-2026-5760 (SGLang): remote code execution through a malicious tokenizer.chat_template in versions before 0.5.11, per NVD, via the /v1/rerank endpoint.

Updating your runtime is good advice, but it fixes a different problem from the one Mir2k exploited.

This was predicted, and the scanners missed it

Short answer: researchers warned about this for over a year. Pillar Security described poisoned GGUF templates in July 2025, a 2026 paper tested the idea on 18 models and four inference engines, and in February 2026 Splunk called the risk "plausible but currently unexploited". November 2026 is the first live sighting these sources describe.

  • 9 Jul 2025, Pillar Security: showed a modified GGUF template could plant a persistent, conditional backdoor, and noted that the Hub page shows only the first GGUF file's template, which Hugging Face judged not a vulnerability.
  • Feb 2026, Fogel et al. (arXiv:2602.04653): across 18 models, a triggered template cut factual accuracy from 90% to 15% on average and made models emit attacker-chosen URLs over 80% of the time. The authors say the poisoned files evaded every security scan on the largest open model platform.
  • 19 Feb 2026, Splunk: surveyed the 156,838 GGUF models listed on Hugging Face in January 2026 and found no active poisoning.
  • 27 Nov 2026, Malspark: reports the first live examples, and no earlier public report of the appended-executable-plus-delayed-template combination.

Hugging Face's malware scanning docs say the scanner covers "every file of your repositories that is smaller than 2 GB". Plenty of GGUF files are bigger and the docs don't say how those are treated, so a green badge shouldn't be your only check. Malspark also says antivirus engines did not flag the live Mir2k files in its tests.

How to check a GGUF file before you use it

Short answer: do four things. Download from the original lab or a publisher you recognise. Compare the file's SHA-256 with the one on the repo page. Look for bytes after the last tensor. Read the tokenizer.chat_template text. None needs the model to run.

I wrote a small script for the last two, using the official gguf Python package from the llama.cpp project. It never loads or runs the model:

import sys, os
from gguf import GGUFReader   # pip install gguf

RED_FLAGS = ["powershell", "invoke-webrequest", "cmd.exe", "curl ", "wget ", "base64",
             "system directive", "must call", "http://", "https://", "%temp%", ".exe"]

path = sys.argv[1]
r = GGUFReader(path)
expected_end = max(t.data_offset + t.n_bytes for t in r.tensors)
size = os.path.getsize(path)
extra = size - expected_end
f = r.fields.get("tokenizer.chat_template")
tpl = f.contents() if f else ""
hits = [w for w in RED_FLAGS if w in tpl.lower()]

print(f"file: {os.path.basename(path)}")
print(f"  bytes after last tensor : {extra}", "OK" if extra == 0 else "SUSPICIOUS")
print(f"  chat template length    : {len(tpl)} characters")
print(f"  red-flag words in it    : {hits if hits else 'none'}")

What I tested. On the official Qwen2.5-0.5B-Instruct Q2_K file from Qwen's own Hugging Face repo it reported 0 bytes after the last tensor, a 2,509-character template and no red-flag words. Then I built two harmless toy GGUF files: one with 1,080 bytes of plain text appended after the last tensor, one with a made-up conditional "directive" in the template that only asks for echo hello. The first was flagged for trailing data, the second for "system directive" and "must call".

Terminal output: the official Qwen file passes, the toy file with appended bytes and the toy trigger-template file are flagged

Output of the script above, re-rendered as an image on 29 Nov 2026. The toy files are harmless test files; I did not download or run any of the five malicious models.

The limits matter. My red-flag list is crude: some legitimate templates contain a URL, and a careful attacker avoids obvious words. A few stray bytes could be padding, though Mir2k's payload was about 11.5 MB. Treat this as a first filter.

For a ready-made tool, Malspark's author published gguf-radar (MIT licence). It parses the template without running it, flags appended bytes and non-zero padding, compares a template with the original model's (compare-template --base) and can rebuild a clean GGUF with the weights unchanged. The repo is new (27 Nov 2026) and I did not run it, so I can't vouch for it beyond its documentation.

Two more habits. Pin the template: Malspark recommends a reviewed template via --chat-template-file in llama.cpp or TEMPLATE in an Ollama Modelfile. Read the diff: compare the embedded template with chat_template in the original model's tokenizer_config.json and read every added line.

What to do if you downloaded one of the five

Short answer: delete the file, work out whether you ever ran a command the model printed or used it behind an agent with a shell, and check your machine against Malspark's indicators. If you did run something, rotate saved passwords. I'm not a security professional, so treat this as general information.

  1. Check whether you pulled any of the five repositories or the Ollama copy timdedid/qwen3-1.7b-cyber, then delete the files. Malspark's report lists hashes, YARA rules and indicators of compromise.
  2. If you never ran a printed command or used the model behind an agent with a shell, the risk is lower. Mir2k files from before 26 Nov hold the payload but not the trigger.
  3. If you might have run it, an advisory tracker suggests rotating browser-saved passwords and wallet extension credentials. If the machine matters, get professional help.

Safer habits for running local models

Short answer: treat a model file like software, not like a song. Get models from original publishers, read the chat template, never paste a command a model suggests, and keep any agent that has a shell inside a container or VM. None of this means you should stop using local models.

  • Prefer originals, or convert GGUFs yourself from official safetensors weights, as some Hacker News readers do. Be warier of "uncensored" uploads.
  • Never paste a command a model suggests. Mir2k's trick needed you to.
  • Keep agents on a short leash: no access to your passwords, and approve risky actions yourself. Update your runtime so the CVE fixes above apply.

Picking a runtime? Read our Ollama vs LM Studio comparison and how much RAM you need to run an LLM locally next.

Written and checked on 29 Nov 2026 by Mo Arfaj. The scan numbers and malware analysis are Malspark's; the Hugging Face and Ollama checks and the script test are my own. General information, not security advice for your systems.

Frequently asked questions

Are GGUF models safe to download?

Mostly, if they come from the original lab or a known publisher, but a GGUF is not just weights. It also holds a chat template that is applied to every prompt and can hold extra bytes after the model data. In November 2026 Malspark found five Hugging Face GGUF models that abused both. Check the source, the template and the end of the file.

Can a GGUF file contain malware?

Yes. Malspark reported that two models from the account Mir2k carried a Windows remote access trojan appended after the last tensor, where loaders such as llama.cpp never read. The file still loaded as a normal model. The trojan only starts if something runs it, which the poisoned chat template tried to get the user to do.

What is chat template poisoning?

A chat template is a small Jinja program stored in the GGUF metadata key tokenizer.chat_template. The runtime uses it to build the text the model reads. If someone edits it, the model can receive instructions you never typed, for example to print a command or to call a shell tool. The extra text never shows in the chat window.

Is safetensors safer than GGUF?

For hidden payloads, yes in one specific way: Malspark says the safetensors loader refuses a file whose declared tensors do not fill it exactly, so bytes cannot be appended. But safetensors and PyTorch models also carry a chat template in a separate file, so template poisoning applies to them too.

What should I do if I downloaded one of the five models?

Delete the file and check the machine. Malspark lists file hashes, YARA rules and indicators of compromise in its report. One advisory tracker suggests rotating passwords saved in your browser and wallet extension credentials if you actually ran one. Mir2k files downloaded before 26 Nov contain the payload but not the template trigger.

Sources

  1. GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400+ Victims - Malspark, 27 Nov 2026
  2. Hugging Face disables five poisoned GGUF models; the agent-hijacking template is still on Ollama - sysnote, 28 Nov 2026
  3. Hugging Face API model records for the five repositories (read by ProductFire, 28 Nov 2026, 20:16 UTC)
  4. Root0ne/gguf-radar (open-source scanner, MIT licence) - GitHub
  5. Inference-Time Backdoors via Chat Templates (Fogel et al.), arXiv:2602.04653
  6. LLM Backdoors at the Inference Level: The Threat of Poisoned Templates - Pillar Security, 9 Jul 2025
  7. Trust at Inference Time: Investigating GGUF Model Templates at Scale - Splunk, 19 Feb 2026
  8. Pickle Scanning - Hugging Face Hub documentation
  9. Malware Scanning - Hugging Face Hub documentation
  10. Safetensors audited as really safe and becoming the default - Hugging Face blog (Trail of Bits audit, March 2023)
  11. Hugging Face AI Platform Riddled With 100 Malicious Code-Execution Models - Dark Reading, 29 Feb 2024 (JFrog research)
  12. CVE-2024-34359 (llama-cpp-python, chat template RCE) - NIST NVD
  13. CVE-2026-27940 (llama.cpp GGUF integer overflow, fixed in b8146) - NIST NVD
  14. CVE-2026-5760 (SGLang chat template RCE, versions before 0.5.11) - NIST NVD
  15. llama.cpp server README: --chat-template-file
  16. Modelfile reference (TEMPLATE) - Ollama docs
  17. GGUF - Hugging Face Hub documentation (metadata viewer)
  18. Five malicious GGUF model repositories on Hugging Face (Mir2k, timdedid): delete the files and rotate browser-stored passwords - Vibe Coding security issue tracker
  19. Hugging Face GGUF malware: Ollama copy still live - i10x, 28 Nov 2026
  20. Ollama model page: timdedid/qwen3-1.7b-cyber (read 28 Nov 2026, 20:16 UTC)
  21. Hacker News discussion: GGUF LLM Models with Hidden Malware on Hugging Face

Spotted a mistake? Read our corrections policy or tell us.

Mo Arfaj

About the author

Mo Arfaj, Founder and Editor-in-Chief

Mo Arfaj is the founder and editor of ProductFire. He writes and edits explainers on AI, tech, business and gaming, and checks every article before it is published.

More from MoHow we fact-check

Comments (0)

No login needed. Your name and comment are public.

0/1000

No comments yet. Be the first to share your view.

Keep reading

The ProductFire Brief

Get explainers like this every week

Free, one email a week. Unsubscribe anytime.

  1. Company RevenueHow Does Marvell Make Money in 2026? Q3 FY27 Preview
  2. EntrepreneurshipMissed Self Assessment Registration Deadline: What to Do
  3. BusinessGmail Send As Ends Jan 2027: 6 Custom Domain Alternatives
  4. Company RevenueHow Does Dell Make Money? AI Servers, PCs & a $132B Backlog
  5. TechSiri AI Daily Limit in iOS 27.3: What You Get for Free