<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Diffusers — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/diffusers/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Thu, 07 May 2026 02:24:22 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/diffusers/feed.xml" rel="self" type="application/rss+xml"/><item><title>Hugging Face Diffusers Remote Code Execution via None.py</title><link>https://feed.craftedsignal.io/briefs/2026-05-diffusers-rce/</link><pubDate>Thu, 07 May 2026 02:24:22 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-diffusers-rce/</guid><description>A remote code execution vulnerability exists in Hugging Face diffusers versions prior to 0.38.0 allowing arbitrary code execution through the `custom_pipeline` flow via a `None.py` file in a Hugging Face Hub repository, bypassing trust checks.</description><content:encoded><![CDATA[<p>A remote code execution (RCE) vulnerability has been identified in Hugging Face diffusers library versions prior to 0.38.0. This flaw stems from insufficient validation in the <code>DiffusionPipeline.from_pretrained</code> function when loading custom pipelines from the Hugging Face Hub. By including a file named <code>None.py</code> in a model repository, an attacker can bypass the <code>trust_remote_code</code> check, leading to arbitrary code execution when a user loads the model. This vulnerability allows attackers to execute malicious code on a user&rsquo;s machine simply by having them load a seemingly benign model, without requiring any explicit trust or custom pipeline specifications. The vulnerability was introduced due to a flaw in how the library resolves custom pipeline paths, leading to the unintentional inclusion of <code>None.py</code> as a valid custom pipeline file.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker creates a Hugging Face Hub repository containing a malicious <code>None.py</code> file, alongside other model files and a <code>model_index.json</code> configuration file.</li>
<li>The <code>None.py</code> file contains malicious code disguised within a class that inherits from <code>DiffusionPipeline</code>, such as shadowing <code>FluxPipeline</code> and executing arbitrary commands like writing a file to <code>/tmp/pwned</code>.</li>
<li>A victim user attempts to load the model using <code>DiffusionPipeline.from_pretrained('attacker/malicious-repo')</code>.</li>
<li>The <code>from_pretrained</code> function calls <code>DiffusionPipeline.download()</code>, which ordinarily checks for <code>trust_remote_code</code> when a custom pipeline is specified.</li>
<li>Due to a flaw, <code>_resolve_custom_pipeline_and_cls</code> resolves <code>custom_pipeline</code> to <code>None.py</code> if the file exists in the repo, bypassing the <code>trust_remote_code</code> check because the check evaluated <code>custom_pipeline is None -&gt; False</code>.</li>
<li>The <code>_get_pipeline_class</code> function is then called with the resolved <code>None.py</code> path, loading and executing the malicious code within the file.</li>
<li>The malicious code executes, performing actions such as creating a file, establishing a reverse shell, or exfiltrating data.</li>
<li>The pipeline is instantiated and appears functional to the user, masking the underlying malicious activity.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows an attacker to achieve remote code execution on the victim&rsquo;s machine. This can lead to complete system compromise, data theft, or deployment of further malicious payloads. The vulnerability affects any user who loads a malicious model from the Hugging Face Hub using the vulnerable versions of the diffusers library.  The impact is significant because it requires no user interaction beyond loading a model, making it easy to exploit at scale.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade the <code>diffusers</code> package to version 0.38.0 or later using <code>pip install --upgrade &quot;diffusers&gt;=0.38.0&quot;</code> to patch the vulnerability as recommended by the vendor.</li>
<li>Implement the provided Sigma rule <code>Detect Diffusers None.py RCE</code> to detect the execution of <code>None.py</code> within the diffusers library.</li>
<li>Prioritize scanning Hugging Face Hub repositories before use, looking for unexpected <code>*.py</code> files, especially <code>None.py</code>, using manual code review or automated tools.</li>
<li>As a workaround, only load models from trusted sources, and inspect local snapshots for unexpected <code>*.py</code> files as described in the advisory.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>rce</category><category>huggingface</category><category>diffusers</category></item></channel></rss>