# CVE-2026-44513: Diffusers: `trust_remote_code` bypass via `custom_pipeline` and local custom components


- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 14 May 2026
- **Updated:** 28 Aug 2026
- **Also known as:** GHSA-98h9-4798-4q5v, PYSEC-2026-40

## What is CVE-2026-44513?

CVE-2026-44513 is a high-severity vulnerability in huggingface diffusers, published on 14 May 2026. 

### Official description

Diffusers is the a library for  pretrained diffusion models. Prior to 0.38.0, 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. DiffusionPipeline.from_pretrained('repoA', custom_pipeline='attacker/repoB', trust_remote_code=False) — the gate evaluated against repoA's file list rather than repoB's, so repoB's pipeline.py was loaded and executed. DiffusionPipeline.from_pretrained('/local/snapshot', custom_pipeline='attacker/repoB', trust_remote_code=False) — the local-path branch never invoked download(), so the gate was never reached and remote code from repoB executed. DiffusionPipeline.from_pretrained('/local/snapshot', trust_remote_code=False) where the snapshot contains custom component files (e.g. unet/my_unet_model.py) referenced from model_index.json — same root cause; the local path skipped download() and custom component code executed. This vulnerability is fixed in 0.38.0.

Weakness: CWE-358 (Improperly Implemented Security Check for Standard), CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2026-44513?

3 open source packages ship an affected version, including diffusers. It affects 1 product.


| Package | Ecosystem | 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: Huggingface Diffusers.

## How do I fix CVE-2026-44513?

Upgrade diffusers to 0.38.0 or later.

## Is CVE-2026-44513 being exploited?

There is no known exploitation of CVE-2026-44513 in the wild and no public exploit code.

## Other vulnerabilities in huggingface diffusers

- [CVE-2026-44827](https://insights.sbomify.com/CVE-2026-44827/): Diffusers: None.py Trust Remote Code Bypass (high 8.8)
- [CVE-2026-45804](https://insights.sbomify.com/CVE-2026-45804/): Diffusers: TOCTOU Trust Remote Code Bypass (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-44513 and fix it if it is affected.

What it is: CVE-2026-44513 is a high-severity vulnerability in huggingface diffusers, published on 14 May 2026. 
Exploitation: There is no known exploitation of CVE-2026-44513 in the wild and no public exploit code.

Affected packages and fixed versions:
- diffusers (PyPI): affected all versions; fixed in 0.38.0
- diffusers (PyPI): affected all versions; fixed in 0.38.0
- diffusers (PyPI): affected all versions; fixed in 0.38.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-44513/ (Markdown: https://insights.sbomify.com/CVE-2026-44513/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-44513
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-44513
- OSV: https://osv.dev/vulnerability/CVE-2026-44513

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-44513/
Summaries are generated and may contain mistakes; the official description above is the record.
