Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…
EPSS 0.6%top 56%

CVE-2026-44827: CWE-94: Improper Control of Generation of Code ('Code Injection') in huggingface diffusers

0
High
VulnerabilityCVE-2026-44827cvecve-2026-44827cwe-94
Published: 05/14/2026 (05/14/2026, 16:33:42 UTC)
Source: CVE Database V5
Vendor/Project: huggingface
Product: diffusers

Description

Diffusers is the a library for pretrained diffusion models. Prior to 0.38.0, diffusers 0.37.0 allows remote code execution without the trust_remote_code=True safeguard when loading pipelines from Hugging Face Hub repositories. The _resolve_custom_pipeline_and_cls function in pipeline_loading_utils.py performs string interpolation on the custom_pipeline parameter using f"{custom_pipeline}.py". When custom_pipeline is not supplied by the user, it defaults to None, which Python interpolates as the literal string "None.py". If an attacker publishes a Hub repository containing a file named None.py with a class that subclasses DiffusionPipeline, the file is automatically downloaded and executed during a standard DiffusionPipeline.from_pretrained() call with no additional keyword arguments. The trust_remote_code check in DiffusionPipeline.download() is bypassed because it evaluates custom_pipeline is not None as False (since the kwarg was never supplied), while the downstream code path that actually loads the module resolves the None value into a valid filename. An attacker can achieve silent arbitrary code execution by publishing a malicious model repository with a None.py file and a standard-looking model_index.json that references a legitimate pipeline class name, requiring only that a victim calls from_pretrained on the repository. This vulnerability is fixed in 0.38.0.

CVSS v3.1

Score 8.8high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected software

diffusers
pkg:pypi/diffusers
Affected versions
<0.38.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 05/14/2026, 17:06:39 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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: 05/14/2026, 16:51:45 UTC

Last enriched: 05/14/2026, 17:06:39 UTC

Last updated: 07/31/2026, 19:22:59 UTC

Views: 102

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses