UTC
High

Diffusers has a `trust_remote_code` bypass via `custom_pipeline` and local custom components

CVE-2026-44513 · GHSA-98h9-4798-4q5v · published 2026-05-07 · updated 2026-06-05

Severity
High
CVSS score
8.8
Chance of exploitation (EPSS)
1.1%
Fixed in
0.38.0
  • Exploitation No known exploitation
  • Automatable No
  • Technical impact Total
  • CISA SSVC
What it is

A trustremotecode bypass in DiffusionPipeline.frompretrained allows arbitrary remote code execution despite the user passing trustremotecode=False (or omitting it, which is the default). The vulnerability has three variants, all sharing the same root cause — the trustremotecode 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: 1. Cross-repo custompipeline. was loaded and executed. 2. Local snapshot + Hub custompipeline. , so the gate was never reached and remote code from repoB executed. 3. Local snapshot with custom components.

What to do

Upgrade diffusers to 0.38.0 or later.

Yes. Fixed in diffusers 0.38.0 via PR #13448. All users on versions < 0.38.0 should upgrade: The fix moves the trustremotecode gate out of DiffusionPipeline.download() and into getcachedmodule_file in , which is the actual chokepoint for every dynamic module load (local, Hub, or community mirror). All three variants now raise ValueError instead of executing untrusted code.

If you cannot upgrade yet

If upgrading immediately is not possible: Only call frompretrained with pretrainedmodelnameorpath, custompipeline, and local snapshot directories from fully trusted sources that have been audited. Do not pass custompipeline= pointing at a Hub repository different from the primary pretrainedmodelnameorpath before reading its pipeline.py. Before calling frompretrained on a local snapshot, inspect the snapshot for unexpected *.py files, especially under component subdirectories (unet/, scheduler/, etc.) and at the snapshot root. These are mitigations, not fixes — the only complete remediation is upgrading to 0.38.0.

Affected
PackageRegistryAffectedFixed in
diffusersPyPI< 0.38.00.38.0
Also in diffusers
  1. HighDiffusers: TOCTOU Trust Remote Code Bypassdiffusers

The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.

Sources: GitHub Advisory Database, reviewed and malware advisories (CC BY 4.0, https://github.com/advisories); advisories published by Cursor (https://github.com/cursor/cursor/security/advisories); advisories published by OpenClaw (https://github.com/openclaw/openclaw/security/advisories); advisories published by vLLM (https://github.com/vllm-project/vllm/security/advisories); advisories published by Open WebUI (https://github.com/open-webui/open-webui/security/advisories); advisories published by n8n (https://github.com/n8n-io/n8n/security/advisories); advisories published by Flowise (https://github.com/FlowiseAI/Flowise/security/advisories); advisories published by Langflow (https://github.com/langflow-ai/langflow/security/advisories); advisories published by the MCP Python SDK project (https://github.com/modelcontextprotocol/python-sdk/security/advisories); advisories published by MLflow (https://github.com/mlflow/mlflow/security/advisories); CISA Known Exploited Vulnerabilities catalog (CC0). Data as of 2026-11-22. ShieldMap describes how each problem works and how to fix it; it does not publish exploit code. Report a correction to [email protected].