{"slug": "gguf-malware-on-hugging-face-a-safe-model-download-checklist-for-local-ai-users", "title": "gguf malware on Hugging Face: A Safe Model Download Checklist for Local AI Users", "summary": "A security write-up by Malspark reported that five malicious GGUF model files on Hugging Face, found in a scan of about 3.27 million public repositories on 26 November, were downloaded 2,428 times. The report describes two techniques: poisoned chat templates that inject PowerShell lines users might copy and run, and trigger phrases that insert hidden system directives telling shell-enabled agents to download and execute scripts. Antivirus engines and checks that inspect only the last few kilobytes of a file missed the compressed payload, according to the post.", "body_md": "**gguf malware** is the phrase local AI users are searching this weekend, after a security write-up reported that malicious GGUF model files on Hugging Face were downloaded 2,428 times ([Malspark](https://malspark.com/blog/malicious-gguf-models-hugging-face/)). If you run models on your own machine with llama.cpp, LM Studio or Ollama, this one is worth ten minutes. Below is a research-based summary of what the report says, plus a short checklist you can use before loading any community model.\n\nAccording to Malspark's post (27 November 2026), a scan of about 3.27 million public Hugging Face model repositories on 26 November found five malicious GGUF models. The author notes that Hugging Face counts downloads, not people, so the number of affected users is at most 2,428.\n\nThe report describes two tricks:\n\n`tokenizer.chat_template`) that the runtime applies to each prompt. In one campaign, the template told the model to start every answer with a PowerShell line the user might copy and run. In another, a trigger phrase made the template insert a hidden \"system directive\" telling an agent with shell access to download and run a script.\nThe post also says antivirus engines and checks that only look at the last few kilobytes of a file did not catch the compressed payload.\n\nThe story reached the Hacker News front page on 28 November ([Hacker News](https://news.ycombinator.com/item?id=50676752)), where several commenters said they already run local models inside a VM or on a separate machine.\n\nThese steps come from the report's own recommendations, plus common-sense habits.\n\n`--chat-template-file` in llama.cpp, or setting `TEMPLATE` in an Ollama `Modelfile`, so the file's built-in template is out of the loop.\n\n```\nllama-cli -m model.gguf --chat-template-file verified_template.jinja\ngguf-radar scan ./model.gguf\ngguf-radar sanitize suspicious.gguf -o clean.gguf\n```\n\nModel files are not just passive weights anymore. The chat template is a small program, and the file can carry extra data your runtime silently skips. A two-minute scan and a reviewed template remove most of the risk described here.\n\nI write short, research-based AI news for small businesses and creators at [ainews.useaifix.com](https://ainews.useaifix.com).", "url": "https://wpnews.pro/news/gguf-malware-on-hugging-face-a-safe-model-download-checklist-for-local-ai-users", "canonical_source": "https://dev.to/useaifix/gguf-malware-on-hugging-face-a-safe-model-download-checklist-for-local-ai-users-2fef", "published_at": "2026-11-28 19:32:33+00:00", "updated_at": "2026-11-28 19:44:15.017911+00:00", "lang": "en", "topics": ["ai-safety", "ai-agents", "ai-tools", "artificial-intelligence"], "entities": ["Hugging Face", "Malspark", "llama.cpp", "Ollama", "LM Studio", "Hacker News"], "also_reported_by": [], "takeaway": "Malicious GGUF files can hide payloads in the chat template and trailing file data that antivirus and last-kilobyte scans miss, so override the built-in template with a reviewed one (llama.cpp's --chat-template-file or Ollama's TEMPLATE) and scan the full file before loading community models.", "recommendation": {"advice": "Scan the entire GGUF file, not just its tail, and load community models with an externally reviewed chat template instead of the file's built-in one.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/gguf-malware-on-hugging-face-a-safe-model-download-checklist-for-local-ai-users", "markdown": "https://wpnews.pro/news/gguf-malware-on-hugging-face-a-safe-model-download-checklist-for-local-ai-users.md", "text": "https://wpnews.pro/news/gguf-malware-on-hugging-face-a-safe-model-download-checklist-for-local-ai-users.txt", "jsonld": "https://wpnews.pro/news/gguf-malware-on-hugging-face-a-safe-model-download-checklist-for-local-ai-users.jsonld"}}