Skip to content
HighVulnerability

GHSA-7wx4-6vff-v64p: Diffusers: TOCTOU Trust Remote Code Bypass

Published
Record updated
View JSON
Affected
  • diffusers < 0.38.0
Fixed in
0.38.0
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.4%

Summary

The `diffusers` package's `DiffusionPipeline.from_pretrained` flow contains a time-of-check/time-of-use flaw in its `trust_remote_code` guard. The guard reads `model_index.json` through `hf_hub_download` from one Hub commit, then `snapshot_download` fetches the files, and these two independent calls can resolve to different commits if the repository changes between them. Because the custom pipeline `.py` file is then imported from the newer snapshot, a custom-code load can run without `trust_remote_code=True`, allowing arbitrary code execution.

Mitigation

The source does not state a fix yet. Check the original advisory for updates.