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
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.
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 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.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| diffusers | PyPI | < 0.38.0 | 0.38.0 |
- CriticalUnauthenticated Remote Code Execution in Langflow via Public Flow Build EndpointlangflowExploited
- CriticalRay is vulnerable to Critical RCE via Safari & Firefox Browsers through DNS Rebinding AttackrayExploited
- CriticalLangflow Unauth RCElangflow, langflow-baseExploited
- HighLiteLLM: Authenticated command execution via MCP stdio test endpointslitellmExploited
- CriticalMLflow vulnerable to remote code execution on unauthenticated servers via third-party scorer deserialization importing caller-placed artifacmlflow
- CriticalAgno: Arbitrary code execution via `eval()` on `field_type` in `FunctionCall`agno
- 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.