The prevailing assumption that GGUF quantized weights are inherently safe because they avoid Python pickle deserialization has been shattered. In November 2026, security researchers from Malspark and Root0ne disclosed five malicious Hugging Face GGUF repositories that had accumulated over 2,400 downloads before takedown. These campaigns, dubbed "Mir2k" and "timdedid," prove that attackers do not need parser memory-corruption exploits to compromise local LLM environments.

Exploiting Intended Features

The "Mir2k" campaign exploited the fact that standard llama.cpp loaders halt at the declared tensor boundary and silently ignore trailing bytes. Attackers appended a Windows Remote Access Trojan named "ollie" directly past the final tensor offset. Days later, the repository’s Jinja chat template was updated to force responses beginning with a PowerShell extraction command, which carved out the appended payload to steal browser credentials, drain crypto wallets, and mine Monero. Simultaneously, the "timdedid" campaign poisoned Jinja2 logic within the chat templates. By injecting conditional rules that triggered on common prompt prefixes like "What is," attackers silently inserted a spoofed [SYSTEM DIRECTIVE]. This tricked autonomous coding agents with shell access into downloading and executing remote PowerShell payloads, effectively hijacking the agent's behavior without altering the model weights themselves.

Hardening the Local Inference Stack

To mitigate these threats, developers must move beyond blind trust in file formats. The primary defense stack involves static inspection using tools like gguf-radar to validate that the mathematical end of declared tensor offsets matches the exact disk file size, stripping any anomalous trailing signatures. Additionally, inspecting tokenizer.chat_template for suspicious {% if %} branches, Base64 payloads, or PowerShell invocation flags is now mandatory before booting any new model. Developers should also prefer official lab releases or convert verified safetensors locally using llama-quantize. Isolation remains critical; running local models inside unprivileged containers or VMs limits the blast radius of agent hijacks by restricting ambient access to SSH keys, .env secrets, and crypto wallets.

Key Takeaways

  • Five malicious GGUF repositories were identified with 2,400+ combined downloads prior to removal.
  • Attackers exploited trailing bytes ignored by llama.cpp and conditional Jinja template logic.
  • The "ollie" RAT used PowerShell to extract payloads for credential theft and Monero mining.
  • Developers should convert verified safetensors locally using llama-quantize instead of downloading raw GGUFs.
  • Isolation via rootless containers or VMs is critical to limit the blast radius of agent hijacks.

The Bottom Line

The belief that GGUF files are inherently safe due to their binary format is a dangerous myth that ignores the attack surface of metadata and templates. Developers must treat every downloaded model as a potential execution vector, prioritizing static analysis and strict sandboxing over convenience.