Why malicious Hugging Face models are a warning for AI developers
JFrog researchers found roughly 100 Hugging Face submissions that performed hidden actions when downloaded and loaded. The most serious cases used pickle files to run unwanted code, including one model that opened a reverse shell.
Hugging Face has become a central place for developers to share and download machine learning models. A report from security firm JFrog shows that the same trust problem long associated with software repositories is now reaching AI model hubs.
“Malicious model files that execute hidden code and open reverse shells point to concrete AI supply-chain security risks and potential loss of control over developer machines.”Why it scores Terminator
According to JFrog researchers, code uploaded to Hugging Face covertly installed backdoors and other malware on end-user machines. The finding is not just about one platform. It is a reminder that AI models can carry executable risk when they are downloaded, loaded, and trusted inside development environments.
What JFrog Found On Hugging Face
JFrog researchers said they found roughly 100 submissions that performed hidden and unwanted actions after being downloaded and loaded onto an end-user device. Most of those flagged machine learning models appeared to be benign proofs of concept, uploaded by researchers or curious users.
The more serious finding was smaller but more important. JFrog researchers said in an email that 10 of the models were “truly malicious” because they took actions that compromised user security when loaded.
Hugging Face did not detect the flagged models before JFrog found them. The platform has since removed the model highlighted in the report and the other submissions JFrog flagged.
For developers, the lesson is direct: a model file is not automatically safe because it sits in a familiar AI repository. If loading the model can trigger code execution, then the model becomes part of the software supply chain.
The Reverse Shell Case
One model drew particular concern because it opened a reverse shell. That mechanism gave a remote device on the Internet full control of the end user’s device.
When JFrog researchers loaded the model in a lab machine, the submission did open a reverse shell but did not take further action. The IP address of the remote device, along with identical shells connecting elsewhere, raised the possibility that the submission may also have been created by researchers.
That does not make the behavior harmless. An exploit that exposes a device to that level of control is a serious breach of researcher ethics, even if it is intended as a demonstration. Once uploaded to a public developer platform, the model can affect users who do not understand that loading it may execute hidden code.
JFrog Senior Researcher David Cohen described the risk plainly: “The model’s payload grants the attacker a shell on the compromised machine, enabling them to gain full control over victims’ machines through what is commonly referred to as a ‘backdoor,’”
He also warned that this type of silent access could reach beyond individual machines. In an organizational setting, a compromised developer device can become a path toward internal systems, sensitive data, or broader security failures.
Why Pickle Made The Attack Possible
The 10 “truly malicious” models all used pickle, a Python format that has long been considered risky. Pickle is commonly used to turn objects and classes into a byte stream that can be saved to disk or shared over a network.
That process is known as serialization. The danger is that deserialization can create an opportunity for attackers to slip malicious behavior into the act of loading a file.
The reverse shell model was submitted by a user named baller432. According to the source article, it evaded Hugging Face’s malware scanner by using pickle’s “__reduce__” method to execute arbitrary code after the model file was loaded.
JFrog’s technical explanation focused on a common loading pattern for PyTorch models with transformers. In that workflow, developers may use the torch.load() function to deserialize a model from a file. For PyTorch models trained with Hugging Face’s Transformers library, that can include the model architecture, weights, and related configuration.
In the repository “baller423/goober2,” JFrog said the malicious payload appeared to be injected into the PyTorch model file through the pickle module’s __reduce__ method. JFrog extracted a payload that connected to RHOST = "210.117.212.93" and RPORT = 4242.
The source article also pointed to a warning from developer Ned Batchelder in a 2020 post: “Pickles can be hand-crafted [to] have malicious effects when you unpickle them. As a result, you should never unpickle data that you do not trust.”
AI Model Hubs Now Face A Familiar Repository Problem
The Hugging Face findings fit a broader pattern. Malicious submissions have affected GitHub, NPM, RubyGems, and other major repositories of open source code for years.
The source article gives two examples. In October 2018, a package that reached PyPi received 171 downloads, not counting mirror sites, before researchers found hidden code designed to steal cryptocurrency from developer machines.
A month later, a backdoor was slipped into event-stream, a code library with 2 million downloads from NPM. Developers of bitcoin wallet CoPay later incorporated the trojanized version of event-stream into an update, which caused CoPay to steal bitcoin wallets from end users by transferring their balances to a server in Kuala Lumpur.
The implication for AI is clear. Model repositories are not exempt from the security problems that follow any public ecosystem where users can upload artifacts that others download and run.
What Developers Should Take From This
The source article does not present a detailed defense checklist, but the facts point to several practical implications for AI development teams.
- Downloaded AI models should be treated as potentially executable software, not just data.
- Model loading paths matter, especially when formats such as pickle are involved.
- Repository scanning can miss malicious behavior, so platform trust alone is not enough.
- Research demonstrations that compromise user machines can create real risk once they are published publicly.
Hugging Face removed the flagged submissions after JFrog identified them. But the broader issue remains: AI developers are increasingly relying on shared models, and those models can contain hidden behavior.
The future of AI development will depend not only on model quality, but also on model provenance, loading safety, and careful vetting. The JFrog report shows that the software supply chain problem has followed developers into the AI era.
Read next