GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400 Victims malspar...

@best30

GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400 Victims malspark.com · 212 points · 61 comments · HN thread

TL;DR A security research post reports that five GGUF model repositories on Hugging Face, found in a scan of all 3.27 million public model repos, carry hidden malware. Two campaigns used chat-template poisoning and bytes appended after the last tensor; the largest (Mir2k) hid a Windows RAT and miner that by then had about 2,428 downloads. The post also releases gguf-radar, an open-source detector and rebuild tool.

  • Scan of 3,273,389 public Hugging Face model repos on 26 Nov 2026 found 5 malicious GGUF models with 2,428 downloads as of 27 Nov; downloads count loads, not unique users.
  • Mir2k campaign hid a Windows x64 program (dubbed 'ollie', ~11.47 MB, mostly a copy of Tor) after the last tensor of two uncensored models, with the chat template switched on to make the model tell users to run a PowerShell line that unpacks it.
  • The implant reportedly sets up persistence via a scheduled task and watchdogs, tries a UAC bypass that fails due to a bug, exfiltrates browser passwords and wallet data, supports keylogging and webcam capture, and mines Monero when idle.
  • timdedid campaign used a trigger phrase in the template to inject a fake [SYSTEM DIRECTIVE] that tells coding agents with shell access to download and run a script; the second stage was not recovered.
  • The authors show three further hiding places in the lab (alignment padding, GGUF/ZIP polyglots, zero-scale Q8_0 blocks) and say gguf-radar detects and cleans them without changing dequantized weights.
  • Recommended mitigations: treat model-suggested commands as untrusted, pin reviewed chat templates, scan models before internal registries, and have hubs reject GGUF files with trailing bytes.

Discussion The thread splits between people who see this as an predictable consequence of running untrusted binary blobs and people who think the risk is overstated at this scale. Many commenters argue the real danger only arises when a model's output is fed into an agent with shell access, and that chat-template tricks are a new variant of older file-parsing attacks. Others focus on the low absolute count (5 of over 3 million repos), question whether download counts are meaningful, and ask why Hugging Face does not scan uploads automatically. The mood is mostly sober and technical, with some sarcasm and a few tangents about movies, games, and drivers.

  • Sandbox agents and assume any model output may be hostile (many): Several commenters say the only real defense is to isolate inference and restrict what agents can do, since weights or templates can encode malicious instructions regardless of file format. Some run llama.cpp in a VM with no outbound access.
  • Trusted uploaders and self-quantizing reduce the risk (some): Users say they stick to vetted publishers like unsloth or convert safetensors to GGUF locally. This is seen as practical but not a full solution, since quantizations can also be tampered with.
  • Hubs and runtimes should add automated metadata checks (many): Commenters argue llama.cpp and Hugging Face should validate headers, reject trailing data, and run tools like gguf-radar on every upload, with quarantine for human review. Others note false positives are possible.
  • Low count makes the threat look minor (some): Some point out 5 malicious repos among millions is a small share, and that malicious ads or vibe-coded apps are a bigger problem. Others say the number will grow as name-brand models become targets.
  • Downloads on HF are misleading (a few): One commenter notes that Hugging Face download counts include routine metadata requests and repeated loads, so the 2,428 figure may overstate the number of distinct victims.
  • Blobs and file parsing have long been risky (some): Commenters compare the issue to codec, font, ebook, and Obsidian plugin exploits, arguing file size is irrelevant and the risk lies in parsers and unsafe wrappers.

Links from the comments

#huggingFace #malware #llamaCpp #gguf #supplyChain #llm