Skip to content

Three vulnerabilities in Hugging Face Diffusers enable code execution via model repositories

Bottom line: Three high-severity flaws in Hugging Face Diffusers bypass the trust_remote_code protection mechanism and enable code execution simply by loading crafted model repositories.

Three security vulnerabilities with high severity have been disclosed in Hugging Face’s Diffusers library, through which manipulated model repositories can execute arbitrary code unnoticed when loaded. The vulnerabilities specifically circumvent the trust_remote_code protective feature.

Security researchers have disclosed three high-severity vulnerabilities in Hugging Face’s Diffusers library, the widely used Python library for loading and running diffusion models for image, video and audio generation. The flaws make it possible to craft model repositories in such a way that they execute arbitrary code on the target system when loaded, without users noticing. This affects the central mechanism used to integrate models from the Hugging Face Hub or other sources into applications.

At the core of the vulnerabilities is the bypass of trust_remote_code, a protective feature designed to prevent unreviewed code from model repositories from being executed. This setting is regarded by many organizations as a standard safeguard when loading models from third-party providers or open repositories. The now-disclosed flaws show that this protection can be circumvented through specially crafted repository content, causing code to execute even when trust_remote_code is set to False or explicitly disabled.

For organizations that integrate AI models from open sources such as the Hugging Face Hub into production environments, training pipelines, or research infrastructure, this creates an attack vector on the AI supply chain itself: a compromised or maliciously crafted model repository can serve as an entry point for code execution on internal systems, regardless of whether it comes from known, verified providers or anonymous uploads. Since Diffusers is used in numerous image and video generation workflows as well as in downstream products, the potential attack surface extends beyond individual data science teams into production applications.

CISOs should promptly assess which internal systems use the Diffusers library and whether the model repositories being loaded originate from sources that are not fully trustworthy. Until patched versions are available or have been rolled out comprehensively, additional isolation of model-loading processes is recommended, for example through sandboxing or restrictive network segmentation, since the bypass of trust_remote_code demonstrates that this setting alone cannot be considered sufficient control against supply-chain risks in the AI ecosystem.


Source: thehackernews.com · Published August 3, 2026
Lumi AI News — AI-assisted curation pursuant to Art. 50 EU AI Act. Paraphrasing and classification by Lumi News Pipeline v1.8.3.

Share on: