On 27 November a security researcher published a write-up on Malspark under the title “GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400+ Victims.” The work behind it is careful: the author scanned every public model repository on Hugging Face on 26 November, 3,273,389 of them, and read GGUF headers and file ends through HTTP Range requests without down any model in full. They parsed 572,184 chat templates without executing any of them. After manual review, five repositories were left, from two accounts, with 2,428 downloads between them as of 27 November.
I’d trust the five. I don’t trust “victims,” and neither does the write-up. Its own summary says: “Hugging Face counts downloads, not people, so the number of affected users is lower or equal.” The question I care about is how much lower, and what the scan does and doesn’t tell us about how common this is.
What the attack does #
A GGUF file has a header, a metadata table, a tensor table, padding and then the weights. One metadata key, tokenizer.chat_template, holds a small Jinja2 program that the runtime runs on every conversation to build the text the model actually reads. The user never sees what it adds.
The larger campaign, from an account called Mir2k, used two hiding places. It appended a Windows executable after the last tensor, where s such as llama.cpp never read. Later it rewrote the chat template to add a hidden system message, in French, telling the model to begin every reply with one PowerShell line. That line finds the largest .gguf file in the user’s profile, reads the bytes at its end, writes them out as %TEMP%\d.exe and starts it. The model prints the command, and the user has to run it.
The write-up’s static analysis describes the implant as a remote access trojan with an embedded copy of Tor. It steals saved browser passwords, targets two crypto wallet extensions, logs keys and mines Monero when the machine is idle. The second account, timdedid, published three copies of a small Qwen3 model whose template inserts a fake “[SYSTEM DIRECTIVE]” when the user’s message contains “What is”. The directive tells an agent with a PowerShell tool to download and run a script. That second-stage script was never recovered.
Neither technique is new. Fogel and colleagues described chat-template backdoors in February 2026 and tested them on 18 models. In their experiments a triggered template cut factual accuracy from 90 percent to 15 percent on average, and the paper reports tool-use hijacking across 3,868 agent episodes. EvilModel showed in 2021 that malware could ride inside a network’s weights. What’s new here is seeing both ideas in live repositories, and seeing the payload planted days before the trigger.
The timeline shrinks the denominator #
The repository history matters more than the download total, because the payload and the trigger arrived at different times.
The write-up states the consequence directly: “Downloads made before 26 November therefore contain the payload but not the trigger.” The chat template lives inside the GGUF file, so a copy pulled on 23 November keeps its clean template unless the user downloads again.
At scan time the five repositories had 1,502 downloads. A day later they had 2,428, and the write-up says the growth was “almost entirely on the two Mir2k models.” The 926 added in that day are the only downloads in the count that certainly came after the scan, when the armed templates were live. Some share of the 1,502 may also postdate arming, since both happened on 26 November, but the post doesn’t say at what hour the counts were taken.
So for Mir2k, which holds 1,946 of the 2,428 downloads (about 80 percent), the population that could have been infected is people who downloaded on 26 or 27 November, on Windows, and then copied and ran a PowerShell line the model printed at the top of its answer. The first armed version also only looked in a fixed path in the Downloads folder. For timdedid it’s users who wired the model into an agent with a PowerShell tool and typed a message containing “What is”. I can’t put a number on either group. I’m fairly confident it is a small fraction of 2,428, and that some of those 926 came from people looking at a malicious model on purpose: researchers, scanners, curious readers.
How big is 1,488? #
Download counts are a weak measure of use in every package ecosystem I know of. Zerouali and colleagues computed nine popularity measures for 175,000 npm packages and concluded that “popularity can be measured with different unrelated metrics.” Among the six measures they compared in detail, the strongest rank correlation of any pair was 0.54, between downloads and a combined GitHub score. A download count says a file was fetched. It doesn’t say by whom, or how many of the fetches were mirrors, scanners or the same person twice.
Still, the comparison to other registries is useful, because malicious packages there are measured the same crude way. Guo and colleagues pulled Google Cloud download records for 861 malicious PyPI package files and found that “6% of the malicious packages were downloaded more than 1,000 times.” In a separate study, Vu, Newman and Meyers cite a sample of 29 PyPI malware packages that averaged under 200 downloads over 20 days. PyPI’s administrators told them that removing every piece of malware is a low priority, because many malicious packages are downloaded very rarely.
By that yardstick the Huihui model did well for an attacker. It’s in the top tier of what PyPI malware reaches, and it got there in about five days, not over a lifetime that for 28 percent of Guo’s packages ran past two months before anyone flagged them. The other four look like ordinary registry malware. My guess is that the names did the work. “Abliterated” and “uncensored” are the labels people look for when they want an unrestricted local model, and Mir2k’s twelve empty placeholders, named after releases such as Qwen4-27B and DeepSeek-V4, show an attacker betting on people grabbing the first quantized upload of a new model. That’s typosquatting adapted to model hubs, where the bait is being first instead of a misspelled name.
The comparison only goes so far. A PyPI download installs code that runs at install time, and Guo found that 580 of the 846 malicious packages they classified, 68.6 percent, attacked during installation. A GGUF download runs nothing. For Mir2k a person still has to paste the command. That makes a model download much less likely to become an infection than a package download, which is one more reason to read 2,428 as an upper bound on an upper bound.
Five in 3.27 million is a floor #
The other tempting reading is the rate. Five malicious repositories out of 3,273,389 is about 1.5 per million. Among the 226,310 GGUF repositories, it’s about 22 per million. One PyPI administrator said publicly that over 12,000 unique projects were removed from PyPI in 2022 for spam, typosquatting and similar abuse, as Vu, Newman and Meyers report, and Zhou and colleagues assembled 24,356 malicious packages from public sources. Next to that, Hugging Face looks almost clean.
I wouldn’t conclude that from this scan, for three reasons the write-up mostly gives itself.
First, it counts only what was still online on 26 November and only what matched two patterns: suspicious template logic and bytes after the last tensor. Anything already taken down, or hidden somewhere else, isn’t in the five. The write-up demonstrates three other hiding places in lab files, including alignment padding and zero-scale weight blocks. None triggers a warning in llama.cpp or gguf-py, and the scan doesn’t claim to have searched for them in the wild.
Second, a single scanner sees a slice. Zhou and colleagues found that “it is essential to collect malicious packages from various online sources because their data overlapping degrees are small.” Different vendors catch different malware. One researcher’s count from one method is a lower bound for the ecosystem.
Third, and to me the most interesting, is the step between the scanner and the five. The write-up says manual review “removed security test repositories, harmless persona prompts and published research samples.” It doesn’t say how many templates the static rules flagged before that review. That number decides whether this kind of scan can run continuously on a model hub.
PyPI has already run into this. Vu, Newman and Meyers interviewed PyPI’s administrators and benchmarked three malware scanners. The administrators “consider a false positive rate of even 0.1% to be unacceptably high, given the large number of package releases that might trigger false alerts.” The measured tools had false positive rates between 15 and 97 percent. The arithmetic is the same here. With five real cases in 572,184 templates, a template scanner that is wrong one time in a thousand produces about 572 false alarms, more than a hundred for each real one. One that performs like the best PyPI check in that benchmark produces about 85,000.
The write-up’s own list of what review removed (security test repos, persona prompts, research samples) suggests the static rules fired on more than five things. I’d like to know how many. If the answer is in the dozens, the template check is precise enough for a hub to run on every upload. If it’s in the thousands, it works as a research sweep and not as a gate.
What’s cheap to fix #
The appended-bytes half of this attack has a structural fix. The write-up points out that the safetensors already “refuses a file whose declared tensors do not fill it exactly.” A GGUF file declares where its data ends, and anything past that point does nothing for the model. Rejecting those bytes at upload costs nothing in false alarms, because a valid file has none. That check doesn’t have the base-rate problem above, because it tests the file’s structure and never has to judge content.
The template half is harder, because templates are code that legitimately varies. For anyone running local models, the write-up’s advice is the one I’d follow: pass a reviewed template with --chat-template-file in llama.cpp, or TEMPLATE in an Ollama Modelfile, whenever the model has tool access. And treat a command the model prints as untrusted, because the template sits between you and the model and you never see what it adds.
As for the 2,428, the honest version of the headline is “five malicious models, downloaded 2,428 times, with an unknown and probably much smaller number of infections.” That’s less dramatic, and it’s also the version the write-up itself supports.
References
- Düzgün. “GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400+ Victims.” Malspark blog, 27 November 2026. Sections 1–6. malspark.com/blog/malicious-gguf-models-hugging-face
- Fogel A, Hofman O, Cohen E, Vainshtein R. “Inference-Time Backdoors via Chat Templates: From LLM Supply Chains to Agentic System Compromise.” arXiv:2602.04653, posted 4 February 2026. arxiv.org/abs/2602.04653
- Wang Z, Liu C, Cui X. “EvilModel: Hiding Malware Inside of Neural Network Models.” arXiv:2107.08590, posted 19 July 2021. arxiv.org/abs/2107.08590
- Zerouali A, Mens T, Robles G, Gonzalez-Barahona JM. “On the Diversity of Software Package Popularity Metrics: An Empirical Study of npm.” 2019 IEEE 26th International Conference on Software Analysis, Evolution and Reengineering (SANER) , February 2019.doi:10.1109/SANER.2019.8667997
- Guo W, Xu Z, Liu C, Huang C, Fang Y, Liu Y. “An Empirical Study of Malicious Code In PyPI Ecosystem.” 2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE) , September 2023.doi:10.1109/ASE56229.2023.00135
- Vu DL, Newman Z, Meyers JS. “Bad Snakes: Understanding and Improving Python Package Index Malware Scanning.” 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE) , May 2023.doi:10.1109/ICSE48619.2023.00052
- Zhou X, Zhang Y, Niu W, Liu J, Wang H, Li Q. “An Analysis of Malicious Packages in Open-Source Software in the Wild.” 2025 55th Annual IEEE/IFIP International Conference on Dependable Systems and Networks (DSN) , June 2025.doi:10.1109/DSN64029.2025.00045