Trust Remote Code Bypass in Hugging Face Diffusers DiffusionPipeline.from_pretrained
CVE-2026-44513 is a code execution vulnerability in Hugging Face Diffusers affecting versions prior to 0.38.0. The flaw is caused by incorrect placement of the trust_remote_code enforcement in DiffusionPipeline.from_pretrained: the security gate was implemented inside DiffusionPipeline.download() rather than at the dynamic module loading site. As a result, code paths that bypassed or short-circuited download() could still reach dynamic loading of untrusted Python modules even when trust_remote_code was explicitly set to False or left at its default value.
The issue includes three related variants sharing the same root cause. In one variant, cross-repository custom pipeline loading evaluates the trust check against the primary repository while actually loading pipeline code from a different attacker-controlled repository via custom_pipeline, allowing untrusted pipeline code to execute. In a second variant, loading from a local snapshot bypasses the download() path entirely, so the trust gate is never reached before remote custom pipeline code is loaded. In a third variant, a local snapshot containing custom component Python modules referenced by model metadata can trigger execution of those component modules because the local-path flow similarly skips the trust check. The net effect is arbitrary code execution during model loading despite the caller attempting to disable remote code trust.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation allows arbitrary attacker-controlled Python code to execute on the system performing model loading. Because exploitation occurs during DiffusionPipeline.from_pretrained initialization, code can run before the caller has an opportunity to validate the loaded pipeline’s behavior. This can enable compromise of the host environment, theft of credentials or tokens accessible to the process, tampering with model-loading workflows, persistence through modified artifacts or environments, and lateral movement from CI/CD runners, notebooks, inference systems, or other production AI infrastructure that loads untrusted model repositories or snapshots.
If you can’t patch tonight, do this now.
If immediate patching is not possible, restrict DiffusionPipeline.from_pretrained usage to fully trusted and audited model sources, custom pipelines, and local snapshot directories. Do not reference a custom_pipeline hosted in a different repository from the primary model unless its code has been reviewed and explicitly trusted. Inspect local snapshots for unexpected Python modules at the snapshot root and within component subdirectories referenced by model metadata. Treat model repositories and snapshots as executable content rather than passive data, and avoid loading unreviewed custom components in sensitive environments.
Patch, then assume compromise.
Upgrade Hugging Face Diffusers to version 0.38.0 or later. The fix moves trust_remote_code enforcement to the dynamic-module loading chokepoint so all affected loading paths consistently validate trust before executing custom pipeline or component code. After upgrading, review model-loading workflows that rely on custom pipelines or local snapshots to ensure they behave as expected under the corrected trust enforcement.
No public exploits tracked yet. Mallory keeps watching.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
7 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.