Attackers are discovering an increasing number of methods to put up malicious tasks to Hugging Face and different repositories for open supply synthetic intelligence (AI) fashions, whereas dodging the websites’ safety checks. The escalating drawback underscores the necessity for firms pursuing inner AI tasks to have strong mechanisms to detect safety flaws and malicious code inside their provide chains.
Hugging Face’s automated checks, for instance, not too long ago did not detect malicious code in two AI fashions hosted on the repository, based on a Feb. 3 evaluation revealed by software program provide chain safety agency ReversingLabs. The risk actor used a typical vector — information information utilizing the Pickle format — with a brand new method, dubbed “NullifAI,” to evade detection.
Whereas the assaults seemed to be proofs-of-concept, their success in being hosted with a “No difficulty” tag exhibits that firms shouldn’t depend on Hugging Face’s and different repositories’ security checks for their very own safety, says Tomislav Pericin, chief software program architect at ReversingLabs.
“You might have this public repository the place any developer or machine studying professional can host their very own stuff, and clearly malicious actors abuse that,” he says. “Relying on the ecosystem, the vector goes to be barely totally different, however the concept is identical: Somebody’s going to host a malicious model of a factor and hope so that you can inadvertently set up it.”
Corporations are shortly adopting AI, and the bulk are additionally establishing inner tasks utilizing open supply AI fashions from repositories — reminiscent of Hugging Face, TensorFlow Hub, and PyTorch Hub. General, 61% of firms are utilizing fashions from the open supply ecosystem to create their very own AI instruments, based on a Morning Seek the advice of survey of two,400 IT decision-makers sponsored by IBM.
But most of the parts can comprise executable code, resulting in quite a lot of safety dangers, reminiscent of code execution, backdoors, immediate injections, and alignment points — the latter being how effectively an AI mannequin matches the intent of the builders and customers.
In an Insecure Pickle
One vital difficulty is {that a} generally used information format, generally known as a Pickle file, will not be safe and can be utilized to execute arbitrary code. Regardless of vocal warnings from safety researchers, the Pickle format continues for use by many information scientists, says Tom Bonner, vp of analysis at HiddenLayer, an AI-focused detection and response agency.
“I actually hoped that we might make sufficient noise about it that Pickle would’ve passed by now, however it’s not,” he says. “I’ve seen organizations compromised via machine studying fashions — a number of [organizations] at this level. So yeah, while it is not an on a regular basis incidence reminiscent of ransomware or phishing campaigns, it does occur.”
Whereas Hugging Face has express checks for Pickle information, the malicious code found by ReversingLabs sidestepped these checks by utilizing a distinct file compression for the information. Different analysis by utility safety agency Checkmarx discovered a number of methods to bypass the scanners, reminiscent of PickleScan utilized by Hugging Face, to detect harmful Pickle information.

Regardless of having malicious options, this mannequin passes safety checks on Hugging Face. Supply: ReversingLabs
“PickleScan makes use of a blocklist which was efficiently bypassed utilizing each built-in Python dependencies,” Dor Tumarkin, director of utility safety analysis at Checkmarx, said within the evaluation. “It’s plainly weak, however by utilizing third-party dependencies reminiscent of Pandas to bypass it, even when it have been to think about all instances baked into Python, it will nonetheless be weak with very fashionable imports in its scope.”
Fairly than Pickle information, information science and AI groups ought to transfer to Safetensors — a library for a brand new information format managed by Hugging Face, EleutherAI, and Stability AI — which has been audited for safety. The Safetensors format is taken into account a lot safer than the Pickle format.
Deep-Seated AI Vulnerabilities
Executable information information should not the one threats, nevertheless. Licensing is one other difficulty: Whereas pretrained AI fashions are steadily referred to as “open supply AI,” they often don’t present all the data wanted to breed the AI mannequin, reminiscent of code and coaching information. As an alternative, they supply the weights generated by the coaching and are lined by licenses that aren’t at all times open supply suitable.
Creating business services or products from such fashions can doubtlessly lead to violating the licenses, says Andrew Stiefel, a senior product supervisor at Endor Labs.
“There’s lots of complexity within the licenses for fashions,” he says. “You might have the precise mannequin binary itself, the weights, the coaching information, all of these might have totally different licenses, and it’s essential to perceive what meaning for your corporation.”
Mannequin alignment — how effectively its output aligns with the builders’ and customers’ values — is the ultimate wildcard. DeepSeek, for instance, permits customers to create malware and viruses, researchers discovered. Different fashions — reminiscent of OpenAI’s o3-mini mannequin, which boasts extra stringent alignment — has already been jail damaged by researchers.
These issues are distinctive to AI programs and the boundaries of methods to check for such weaknesses stays a fertile subject for researchers, says ReversingLabs’ Pericin.
“There may be already analysis about what sort of prompts would set off the mannequin to behave in an unpredictable manner, reveal confidential info, or educate issues that could possibly be dangerous,” he says. “That is an entire different self-discipline of machine studying mannequin security that individuals are, in all honesty, largely apprehensive about at the moment.”
Corporations ought to make sure that to know any licenses overlaying the AI fashions they’re utilizing. As well as, they need to take note of widespread indicators of software program security, together with the supply of the mannequin, improvement exercise across the mannequin, its recognition, and the operational and safety dangers, Endor’s Stiefel says.
“You form of must handle AI fashions such as you would another open supply dependencies,” Stiefel says. “They’re constructed by individuals exterior of your group and also you’re bringing them in, and so meaning it’s essential to take that very same holistic strategy to taking a look at dangers.”