CVE-2026-44513: Diffusers: `trust_remote_code` bypass via `custom_pipeline` and local custom components
Diffusers is the a library for pretrained diffusion models. Prior to 0.38.0, a trust_remote_code bypass in DiffusionPipeline.from_pretrained allows arbitrary remote code execution despite the user passing trust_remote_code=False (or omitting it, which is the default). The vulnerability has three variants, all sharing the same root cause — the trust_remote_code gate was implemented inside DiffusionPipeline.download() rather than at the actual dynamic-module load site, so any code path that bypassed or short-circuited download() also bypassed the security check. DiffusionPipeline.from_pretrained('repoA', custom_pipeline='attacker/repoB', trust_remote_code=False) — the gate evaluated against repoA's file list rather than repoB's, so repoB's pipeline.py was loaded and executed. DiffusionPipeline.from_pretrained('/local/snapshot', custom_pipeline='attacker/repoB', trust_remote_code=False) — the local-path branch never invoked download(), so the gate was never reached and remote code from repoB executed. DiffusionPipeline.from_pretrained('/local/snapshot', trust_remote_code=False) where the snapshot contains custom component files (e.g. unet/my_unet_model.py) referenced from model_index.json — same root cause; the local path skipped download() and custom component code executed. This vulnerability is fixed in 0.38.0.
Security readout for executives and security teams
Plain-English summary
Applications using vulnerable Hugging Face Diffusers can execute code supplied through a malicious model pipeline or custom component even when remote code was explicitly disabled. Successful exploitation could compromise the application’s data, integrity, and availability. The issue is fixed in Diffusers 0.38.0.
Executive priority
Treat this as a high-priority patch for AI services that load third-party or user-selected models. Accelerate remediation for internet-facing, multi-tenant, or sensitive-data workloads. Where model inputs are tightly controlled, schedule prompt upgrading while confirming those controls.
Technical view
Before 0.38.0, DiffusionPipeline.from_pretrained enforced trust_remote_code inside download() rather than where dynamic modules were loaded. Remote custom_pipeline references and local snapshots could bypass or skip that check, allowing attacker-controlled Python components to execute. The CVSS 3.1 score is 8.8 and user interaction is required.
Likely exposure
Exposure is most likely where Diffusers versions below 0.38.0 load models, custom pipelines, or local snapshots from untrusted or externally influenced sources. Systems using only trusted, controlled artifacts may face lower practical risk, but remain affected until upgraded.
Exploitation context
The supplied sources do not establish active exploitation, and the CVE is not listed as KEV in the bundle. Exploitation requires a user or application workflow to load an attacker-controlled pipeline or custom component. No privileges are required, and successful execution occurs in the application’s security context.
Researcher notes
The three reported variants share a misplaced authorization check: download-time validation did not cover every dynamic-module loading path. Assessment should therefore focus on effective module provenance at runtime, not merely whether trust_remote_code is false. The bundle provides no evidence of public exploitation or exploit maturity.
Mitigation direction
Upgrade Hugging Face Diffusers to version 0.38.0 or later.
Prioritize systems that ingest third-party models, custom pipelines, or externally supplied snapshots.
Until upgraded, restrict model and pipeline sources to reviewed, organization-controlled repositories.
Review Hugging Face and downstream vendor guidance for deployment-specific remediation.
Validation and detection
Confirm the runtime-resolved Diffusers version is 0.38.0 or later.
Inventory calls to DiffusionPipeline.from_pretrained and identify custom_pipeline usage or local snapshot loading.
Verify model repositories, snapshots, and custom component files come from approved sources.
Review affected workloads for unexpected code execution associated with recent model-loading activity.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-358: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
5Timeline events
2ADP providers
6Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-358 · source CWE mapping
Improperly Implemented Security Check for Standard
Improperly Implemented Security Check for Standard represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Improper Control of Generation of Code ('Code Injection')
Improper Control of Generation of Code ('Code Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.