Malicious Launch Commands Hidden in Chat Templates of GGUF Models
You download an "uncensored" GGUF model from Hugging Face and get invisible instructions along with it. According to Malspark, the chat template hides a system prompt that standard interfaces do not show. In one case, the prompt makes the model download and run a malicious script; in another, it extracts a script embedded in the file itself. Models from unverified sources should therefore be treated as code, not as harmless weights.
AI-processed from TG: @derplearning (Derp Learning); edited by Hamidun News
The usual routine: you go to Hugging Face, find a fresh "uncensored" GGUF file, download it, and run it locally. Weights are just numbers, what could happen? Researchers at Malspark have shown that quite a lot can happen: the published models contained hidden instructions that turn a harmless chat into a channel for delivering malicious code. The finding was reported by the Telegram channel Derp Learning, which linked to the Malspark report.
What exactly is hidden in the model
Most chat models have a dialogue template. It determines how user and assistant messages are joined into a single text that the neural network sees. In GGUF, this template is stored directly in the file's metadata and applied automatically when you run the model through llama.cpp, Ollama, LM Studio, and similar programs.
This is where the harmful payload is hidden. An attacker adds a system prompt to the template, meaning an instruction the model receives before each of your messages. Standard interfaces show only your conversation and the replies, so this service text stays out of view. It works like a hidden note to a waiter: you order one thing, but he has been instructed in advance to do another.
Two attack scenarios
According to the post, two variants were found.
In the first, the hidden prompt makes the model download a malicious script and run it. This is dangerous wherever the model has access to tools: a terminal, code execution, a browser, or an agent framework. The more rights you give a local assistant, the easier it is for it to "carry out the task."
In the second variant, the script is embedded in the GGUF file in advance, and the hidden instruction tells the model to extract it from there. No network request is needed in this case, so such a scheme is easier to slip past filters that monitor downloads.
An important caveat: these scenarios apply when the model can actually execute commands. If you simply chat with a model in an isolated window without tools, the worst it will do is produce strange or intrusive text. But agent and coding setups with automatic command execution are now commonplace, and the line between "chatting" and "executing" is quickly blurring.
What developers and teams should do
The main lesson is to treat a model file not as a set of numbers but as an artifact with executable behavior. The practical steps are fairly down to earth:
- Before running a model, open its metadata and read the chat template field. Any links, shell commands, or mentions of curl, wget, powershell, or base64 are a reason to stop.
- Do not give a local model access to the terminal or file system without a sandbox: a container, a virtual machine, or a separate user with minimal rights.
- Download quantizations from authors and organizations you already trust, not from random accounts with trendy names. Verify the repository against the model's official source.
- In corporate environments, maintain an allowlist of model sources and scan files the same way you scan dependencies and Docker images.
- If you build products on open models, pin file hashes and do not allow automatic updates from external repositories.
Why this matters right now
Open models have become a mass-market tool, and GGUF has become the de facto standard for local deployment. Around popular weights, an ecosystem of fine-tunes, "uncensored" versions, and quantizations from unknown authors is growing quickly. This is an ideal environment for supply-chain attacks: users go looking for "modified" versions themselves and readily drop their caution.
The danger is amplified by the fact that the hidden prompt is invisible to the eye. Classic antivirus tools are not built to check dialogue templates, and developers are not in the habit of reading model metadata. Until the industry develops standards for signing and verifying models, responsibility rests with those who download them.
The post's irony is accurate: not only those who make open source have learned to earn money from it. For practitioners, the takeaway is simple: treat others' weights with the same caution you would apply to someone else's executable, and do not run them with broad permissions until you have checked what is inside.
- Nov 28, 2026A 74 KB AI Hypervisor Repairs a Crashing Linux Kernel on the Fly: 97.54% Correct Patches Across 122 Crashes
- Nov 28, 2026A Russian developer wrote a 24 KB OS where Qwen3 generates text 54% faster than llama.cpp
- Nov 28, 2026A Qwen3-0.6B Engine Written in Assembly Fits in 14.7 KB and Runs 18–36% Faster Than llama.cpp on CPU
- Nov 28, 2026Five GGUF Models on Hugging Face Found Hiding Malware: 2,400+ Downloads
Key Questions Answered
What exactly is hidden in the model?
Most chat models have a dialogue template. It determines how user and assistant messages are joined into a single text that the neural network sees. In GGUF, this template is stored directly in the file's metadata and applied automatically when you run the model through llama.cpp, Ollama, LM Studio, and similar programs. This is where the harmful payload is hidden. An attacker adds a system prompt to the template, meaning an instruction the model receives before each of your messages.
What are the key details on Two attack scenarios?
According to the post, two variants were found. In the first, the hidden prompt makes the model download a malicious script and run it. This is dangerous wherever the model has access to tools: a terminal, code execution, a browser, or an agent framework. The more rights you give a local assistant, the easier it is for it to "carry out the task." In the second variant, the script is embedded in the GGUF file in advance, and the hidden instruction tells the model to extract it from there.
What developers and teams should do?
The main lesson is to treat a model file not as a set of numbers but as an artifact with executable behavior. The practical steps are fairly down to earth: Before running a model, open its metadata and read the chat template field. Any links, shell commands, or mentions of curl, wget, powershell, or base64 are a reason to stop. Do not give a local model access to the terminal or file system without a sandbox: a container, a virtual machine, or a separate user with minimal rights.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
