CVE-2026-44513: Diffusers has a `trust_remote_code` bypass via `custom_pipeline` and local custom components
(updated )
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:
- Cross-repo
custom_pipeline.DiffusionPipeline.from_pretrained('repoA', custom_pipeline='attacker/repoB', trust_remote_code=False)— the gate evaluated againstrepoA’s file list rather thanrepoB’s, sorepoB’spipeline.pywas loaded and executed. - Local snapshot + Hub
custom_pipeline.DiffusionPipeline.from_pretrained('/local/snapshot', custom_pipeline='attacker/repoB', trust_remote_code=False)— the local-path branch never invokeddownload(), so the gate was never reached and remote code fromrepoBexecuted. - Local snapshot with custom components.
DiffusionPipeline.from_pretrained('/local/snapshot', trust_remote_code=False)where the snapshot contains custom component files (e.g.unet/my_unet_model.py) referenced frommodel_index.json— same root cause; the local path skippeddownload()and custom component code executed.
Silent remote code execution on the victim’s machine. Anyone calling DiffusionPipeline.from_pretrained with custom pipelines is impacted.
References
- github.com/advisories/GHSA-98h9-4798-4q5v
- github.com/huggingface/diffusers/commit/a37f6f8394ac2a7ee8360c3abea811efe54512b1
- github.com/huggingface/diffusers/issues/13446
- github.com/huggingface/diffusers/pull/13448
- github.com/huggingface/diffusers/releases/tag/v0.38.0
- github.com/huggingface/diffusers/security/advisories/GHSA-98h9-4798-4q5v
- github.com/pypa/advisory-database/tree/main/vulns/diffusers/PYSEC-2026-40.yaml
- nvd.nist.gov/vuln/detail/CVE-2026-44513
Code Behaviors & Features
Detect and mitigate CVE-2026-44513 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →