Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. diffusers
  4. ›
  5. CVE-2026-44513

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

May 7, 2026

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:

  1. Cross-repo custom_pipeline. 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.
  2. Local snapshot + Hub custom_pipeline. 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.
  3. 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 from model_index.json — same root cause; the local path skipped download() 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
  • 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
  • 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. Learn more about Dependency Scanning →

Affected versions

All versions before 0.38.0

Fixed versions

  • 0.38.0

Solution

Upgrade to version 0.38.0 or above.

Impact 8.8 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

pypi/diffusers/CVE-2026-44513.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 00:18:53 +0000.