Impact
The diffusers library performs string interpolation on the custom_pipeline parameter, defaulting to the literal string "None.py" when the user does not supply a value. An attacker can publish a repository containing a file named None.py that declares a subclass of DiffusionPipeline. When a downstream user calls DiffusionPipeline.from_pretrained() on the repository, the library automatically downloads and executes that file, bypassing the trust_remote_code safeguard. This flaw is a form of dynamic code injection (CWE-94) and allows an attacker to run arbitrary code with the privileges of the process that performed the loading, compromising confidentiality, integrity, and availability of the host system.
Affected Systems
The vulnerability affects the Hugging Face diffusers library in all releases before 0.38.0, including 0.37.0 and earlier. The issue resides in the _resolve_custom_pipeline_and_cls function within pipeline_loading_utils.py, which resolves the custom_pipeline parameter even when it is implicitly None.
Risk and Exploitability
With a CVSS score of 8.8 the flaw is classified as high severity. An exploit requires only that a user load a model from an untrusted Hub repository; no special conditions or additional credentials are needed. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog. Attackers can achieve silent, arbitrary code execution by simply hosting a malicious model repository containing a None.py file.
OpenCVE Enrichment
Github GHSA