CVE-2026-45804 Diffusers: TOCTOU Trust Remote Code Bypass
Attackers can execute arbitrary code by exploiting a race condition in Diffusers' model loading, bypassing remote code trust checks.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-45804?
CVE-2026-45804 is a high-severity vulnerability in huggingface diffusers, published on 15 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
Diffusers is the a library for pretrained diffusion models. Prior to 0.38.0, Diffusers' DiffusionPipeline.from_pretrained flow can bypass the trust_remote_code guard because download() validates model_index.json and custom pipeline code before later loading from a cached folder that can change, allowing a Hub repository with custom .py pipeline code to execute through the custom pipeline flow without passing custom_pipeline or trust_remote_code=True. This issue is fixed in version 0.38.0.
Weakness: CWE-367
Which versions are affected by CVE-2026-45804?
3 open source packages ship an affected version, including diffusers. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
diffusers PyPI | All versions | 0.38.0 |
diffusers PyPI | All versions | 0.38.0 |
diffusers PyPI | All versions | 0.38.0 |
Products include Huggingface Diffusers.
How do I fix CVE-2026-45804?
Upgrade diffusers to 0.38.0 or later.
Is CVE-2026-45804 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-45804 exists.
Other vulnerabilities in huggingface diffusers
Sources
Also known as GHSA-7wx4-6vff-v64p, PYSEC-2026-2446.