REDHAT-BUG-2477507: High severity Hugging Face Diffusers vulnerability
Diffusers is the a library for pretrained diffusion models. Prior to 0.38.0, a trustremotecode bypass in DiffusionPipeline.frompretrained allows arbitrary remote code execution despite the user passing trustremotecode=False (or omitting it, which is the default). The vulnerability has three variants, all sharing the same root cause — the trustremotecode 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.frompretrained('repoA', custompipeline='attacker/repoB', trustremotecode=False) — the gate evaluated against repoA's file list rather than repoB's, so repoB's pipeline.py was loaded and executed. DiffusionPipeline.frompretrained('/local/snapshot', custompipeline='attacker/repoB', trustremotecode=False) — the local-path branch never invoked download(), so the gate was never reached and remote code from repoB executed. DiffusionPipeline.frompretrained('/local/snapshot', trustremotecode=False) where the snapshot contains custom component files (e.g. unet/myunetmodel.py) referenced from modelindex.json — same root cause; the local path skipped download() and custom component code executed. This vulnerability is fixed in 0.38.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
diffusersto a version that resolves this vulnerability.Fixed in 0.38.0
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2477507?
The severity of REDHAT-BUG-2477507 is high, rated at 7.
What is the risk associated with REDHAT-BUG-2477507?
The risk associated with REDHAT-BUG-2477507 is categorized as 33.
How do I fix REDHAT-BUG-2477507?
To fix REDHAT-BUG-2477507, upgrade the Hugging Face Diffusers library to version 0.38.0 or later.
What impact does REDHAT-BUG-2477507 have on security?
REDHAT-BUG-2477507 allows for arbitrary remote code execution even when trust_remote_code is set to False.
Which library is affected by REDHAT-BUG-2477507?
The affected library is Hugging Face Diffusers prior to version 0.38.0.