Security researchers have identified three high-severity vulnerabilities, collectively named 'FaceHugger,' in Hugging Face's popular open-source Diffusers library. This library, downloaded millions of times monthly, is a cornerstone for developers working with generative AI models. The vulnerabilities allow a maliciously crafted AI model repository to bypass the trust_remote_code security mechanism, which is designed to prevent untrusted code execution. Successful exploitation enables arbitrary code execution on the machine that loads the model, creating a critical AI supply chain risk. An attacker could publish a malicious model that, when used by a developer or in a production pipeline, compromises the underlying system. Hugging Face has addressed the flaws in Diffusers version 0.38.0, and all users are advised to upgrade immediately.
The core issue behind the 'FaceHugger' flaws is the ability to circumvent the trust_remote_code=false setting in the DiffusionPipeline.from_pretrained function. This setting is a developer's primary defense against malicious code embedded within model repositories.
The three vulnerabilities are:
custom_pipeline feature can be abused to load and execute code even when trust_remote_code is set to false.None.py is not properly checked by the security mechanism, allowing its code to be executed.These vulnerabilities mean that a simple, common command to load an AI model can become an initial access vector for an attacker.
The vulnerabilities affect any developer, researcher, or organization using a vulnerable version of the Hugging Face Diffusers library (versions prior to 0.38.0). Given the library's popularity (over 8 million downloads in July 2026 alone), the potential scope of impact is massive. This includes:
The vulnerabilities were responsibly disclosed by researchers at Zafran Labs. There is no public evidence of these flaws being exploited in the wild. However, the public disclosure of the technical details increases the risk that malicious actors will attempt to create and publish poisoned models to trap unsuspecting developers. The ease of publishing models on the Hugging Face Hub makes this a scalable attack vector.
The 'FaceHugger' vulnerabilities represent a significant threat to the security of the AI ecosystem.
This is a stark reminder that AI models are not just data; they are often bundled with executable code, and the toolchains used to handle them must be secure.
No specific indicators of compromise were mentioned, as the vulnerabilities were not observed being exploited in the wild.
To detect potential exploitation, security teams can monitor for:
file_nameNone.pynetwork_traffic_patternprocess_namesh, bash, cmd.exe, powershell.exe) from a Python processdiffusers library and flag them for immediate update. This is an application of D3FEND Application Framework Hardening (D3-AFH).None.py), and review any linked code.diffusers library to version 0.38.0 or newer. This can be done via pip: pip install --upgrade diffusers. This is a direct application of D3FEND Software Update (D3-SU).trust_remote_code=true, manually review the code in the repository before running it. Do not blindly trust code from unknown sources.Updating the diffusers library to a patched version is the most direct and effective mitigation.
Running model loading and inference in a sandboxed environment can contain the impact of a malicious model.
Use security policies or tools to prevent Python processes from spawning unexpected child processes like shells.
The primary and most effective mitigation is for all developers and organizations to update their diffusers library to version 0.38.0 or later. This can be accomplished with the command pip install --upgrade diffusers. Organizations should integrate software composition analysis (SCA) tools into their CI/CD pipelines to automatically scan for and flag vulnerable dependencies like this one, ensuring that builds fail if they include insecure components. This proactive dependency management is essential for maintaining the security of the AI software supply chain.
When working with any untrusted model from a public repository like Hugging Face Hub, always execute the code in a secure, isolated sandbox. This could be a Docker container with restricted network access and read-only filesystem mounts, or a dedicated, non-persistent virtual machine. During execution, monitor the process's behavior using dynamic analysis tools. Look for any suspicious system calls, file I/O operations outside of the expected cache directories, or any attempt to establish a network connection. This sandboxing approach contains the potential damage from a malicious model and allows for safe analysis of its behavior before it is promoted to a more trusted environment.
Hugging Face releases Diffusers version 0.38.0, which patches the 'FaceHugger' vulnerabilities.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
CyberNetSec.io uses automation to assist source monitoring, deduplication, observable extraction, and structured intelligence generation. Published analysis follows human-defined editorial standards and adds defensive context including MITRE ATT&CK, D3FEND, STIX, and Sigma where applicable. Read our editorial policy.
Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.
Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.
Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.
Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.
Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.