CVE-2026-44827: CWE-94: Improper Control of Generation of Code ('Code Injection') in huggingface diffusers
CVE-2026-44827 is a high-severity code injection vulnerability in the Hugging Face diffusers library versions prior to 0. 38. 0. It allows remote code execution when loading pipelines from Hugging Face Hub repositories without explicitly setting the trust_remote_code=True safeguard. The vulnerability arises because the pipeline loading function interpolates a custom pipeline filename from a parameter that defaults to None, which Python converts to the string "None. py". An attacker can publish a malicious repository containing a None. py file with a subclass of DiffusionPipeline, which is automatically downloaded and executed during a standard pipeline loading call. This bypasses the trust_remote_code check, enabling silent arbitrary code execution. The issue is fixed in version 0.
AI Analysis
Technical Summary
The diffusers library for pretrained diffusion models has a code injection vulnerability (CWE-94) in versions before 0.38.0. The _resolve_custom_pipeline_and_cls function uses string interpolation on the custom_pipeline parameter, which defaults to None and becomes "None.py". If an attacker publishes a repository with a malicious None.py file defining a DiffusionPipeline subclass, it is automatically loaded and executed when a user calls DiffusionPipeline.from_pretrained() without specifying custom_pipeline or trust_remote_code=True. The trust_remote_code check is bypassed because it only evaluates if custom_pipeline is not None, which is False when the parameter is omitted, but the downstream code still loads the None.py file. This leads to remote code execution. The vulnerability is resolved in diffusers version 0.38.0.
Potential Impact
An attacker can achieve remote arbitrary code execution on a victim's system by publishing a malicious model repository containing a None.py file with a DiffusionPipeline subclass. When a victim loads this repository using DiffusionPipeline.from_pretrained() without the trust_remote_code=True flag, the malicious code executes silently. This can lead to full compromise of the affected system. The CVSS v3.1 score is 8.8 (high), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, and high confidentiality, integrity, and availability impacts.
Mitigation Recommendations
Upgrade the diffusers library to version 0.38.0 or later, where this vulnerability is fixed. Until upgrading, users should explicitly set trust_remote_code=True only when they trust the source of the model repository. Avoid loading pipelines from untrusted or unknown Hugging Face Hub repositories without this safeguard. Patch status is not explicitly stated in the vendor advisory, but the fix is included in version 0.38.0.
CVE-2026-44827: CWE-94: Improper Control of Generation of Code ('Code Injection') in huggingface diffusers
Description
CVE-2026-44827 is a high-severity code injection vulnerability in the Hugging Face diffusers library versions prior to 0. 38. 0. It allows remote code execution when loading pipelines from Hugging Face Hub repositories without explicitly setting the trust_remote_code=True safeguard. The vulnerability arises because the pipeline loading function interpolates a custom pipeline filename from a parameter that defaults to None, which Python converts to the string "None. py". An attacker can publish a malicious repository containing a None. py file with a subclass of DiffusionPipeline, which is automatically downloaded and executed during a standard pipeline loading call. This bypasses the trust_remote_code check, enabling silent arbitrary code execution. The issue is fixed in version 0.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The diffusers library for pretrained diffusion models has a code injection vulnerability (CWE-94) in versions before 0.38.0. The _resolve_custom_pipeline_and_cls function uses string interpolation on the custom_pipeline parameter, which defaults to None and becomes "None.py". If an attacker publishes a repository with a malicious None.py file defining a DiffusionPipeline subclass, it is automatically loaded and executed when a user calls DiffusionPipeline.from_pretrained() without specifying custom_pipeline or trust_remote_code=True. The trust_remote_code check is bypassed because it only evaluates if custom_pipeline is not None, which is False when the parameter is omitted, but the downstream code still loads the None.py file. This leads to remote code execution. The vulnerability is resolved in diffusers version 0.38.0.
Potential Impact
An attacker can achieve remote arbitrary code execution on a victim's system by publishing a malicious model repository containing a None.py file with a DiffusionPipeline subclass. When a victim loads this repository using DiffusionPipeline.from_pretrained() without the trust_remote_code=True flag, the malicious code executes silently. This can lead to full compromise of the affected system. The CVSS v3.1 score is 8.8 (high), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, and high confidentiality, integrity, and availability impacts.
Mitigation Recommendations
Upgrade the diffusers library to version 0.38.0 or later, where this vulnerability is fixed. Until upgrading, users should explicitly set trust_remote_code=True only when they trust the source of the model repository. Avoid loading pipelines from untrusted or unknown Hugging Face Hub repositories without this safeguard. Patch status is not explicitly stated in the vendor advisory, but the fix is included in version 0.38.0.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-07T21:21:48.351Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a05fda1ec166c07b0f931e0
Added to database: 5/14/2026, 4:51:45 PM
Last enriched: 5/14/2026, 5:06:39 PM
Last updated: 5/14/2026, 6:01:26 PM
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.