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.
Published: 2026-07-15
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Diffusers is a library for pretrained diffusion models. Prior to 0.38.0, the DiffusionPipeline.from_pretrained flow bypasses the trust_remote_code guard because the download() step validates model_index.json and any custom pipeline code, but a subsequent load from a cached folder can overwrite those files. This allows an attacker to host a repository containing malicious .py pipeline code that is executed when the custom pipeline flow is used without specifying custom_pipeline or trust_remote_code=True, resulting in remote code execution. The flaw is a classic time‑of‑check to time‑of‑use race that enables uncontrolled code execution.

Affected Systems

Huggingface Diffusers library before version 0.38.0. Any instance that loads custom pipelines from the Huggingface Hub without explicitly enabling trust_remote_code or providing a custom_pipeline path will be vulnerable.

Risk and Exploitability

The CVSS score of 7.5 indicates a high severity. The EPSS score of less than 1% shows low current exploitation probability, and the vulnerability is not listed in the CISA KEV catalog. The likely attack vector is remote: an attacker hosts a malicious repository on the Huggingface Hub, causes a user to download and load its custom pipeline, and thereby injects executable code. Exploitation requires an environment that follows the default DiffusionPipeline.from_pretrained flow without additional safeguards.

Generated by OpenCVE AI on July 31, 2026 at 03:24 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Diffusers to version 0.38.0 or later, which contains the fix for the TOCTOU race.
  • When using custom pipelines, explicitly set trust_remote_code=True or provide a custom_pipeline path to control the code that is executed.
  • Validate model_index.json files locally and refrain from loading untrusted repositories without proper safeguards.

Generated by OpenCVE AI on July 31, 2026 at 03:24 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-7wx4-6vff-v64p Diffusers: TOCTOU Trust Remote Code Bypass
History

Thu, 16 Jul 2026 12:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-94
References
Metrics threat_severity

None

threat_severity

Important


Wed, 15 Jul 2026 19:00:00 +0000

Type Values Removed Values Added
First Time appeared Huggingface
Huggingface diffusers
Vendors & Products Huggingface
Huggingface diffusers

Wed, 15 Jul 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Wed, 15 Jul 2026 16:30:00 +0000

Type Values Removed Values Added
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.
Title Diffusers: TOCTOU Trust Remote Code Bypass
Weaknesses CWE-367
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H'}


Subscriptions

Huggingface Diffusers
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-15T17:27:31.546Z

Reserved: 2026-05-13T08:19:32.604Z

Link: CVE-2026-45804

cve-icon Vulnrichment

Updated: 2026-07-15T17:27:17.463Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Important

Publid Date: 2026-07-15T16:05:35Z

Links: CVE-2026-45804 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T03:30:18Z

Weaknesses
  • CWE-367

    Time-of-check Time-of-use (TOCTOU) Race Condition

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')