<?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>Trust_remote_code — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/trust_remote_code/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Thu, 07 May 2026 05:31:17 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/trust_remote_code/feed.xml" rel="self" type="application/rss+xml"/><item><title>Diffusers trust_remote_code Bypass Leads to Remote Code Execution</title><link>https://feed.craftedsignal.io/briefs/2026-05-diffusers-rce/</link><pubDate>Thu, 07 May 2026 05:31:17 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-diffusers-rce/</guid><description>A `trust_remote_code` bypass vulnerability exists in the `DiffusionPipeline.from_pretrained` function of the diffusers library, allowing for arbitrary remote code execution when using `custom_pipeline` and local custom components, even when `trust_remote_code=False` is set.</description><content:encoded><![CDATA[<p>A <code>trust_remote_code</code> bypass in <code>DiffusionPipeline.from_pretrained</code> allows arbitrary remote code execution despite the user passing <code>trust_remote_code=False</code> (or omitting it, which is the default). The vulnerability, impacting diffusers versions before 0.38.0, stems from the <code>trust_remote_code</code> gate being implemented inside <code>DiffusionPipeline.download()</code> rather than at the actual dynamic-module load site. This allows for bypasses using cross-repo <code>custom_pipeline</code>, local snapshots with Hub <code>custom_pipeline</code>, and local snapshots with custom components. Successful exploitation results in silent remote code execution on the victim&rsquo;s machine, affecting anyone calling <code>DiffusionPipeline.from_pretrained</code> with custom pipelines. The vulnerability is tracked as CVE-2026-44513.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>A user calls <code>DiffusionPipeline.from_pretrained</code> with a malicious <code>custom_pipeline</code> pointing to an attacker&rsquo;s repository (repoB) while setting <code>trust_remote_code=False</code>.</li>
<li>The <code>DiffusionPipeline.download()</code> function is invoked, but the trust check is performed against the primary repository (repoA) instead of the attacker&rsquo;s repository (repoB).</li>
<li>Alternatively, the user calls <code>DiffusionPipeline.from_pretrained</code> with a local snapshot directory and a malicious <code>custom_pipeline</code> pointing to an attacker&rsquo;s repository. The local-path branch bypasses the <code>download()</code> function, thus skipping the <code>trust_remote_code</code> gate.</li>
<li>As another alternative, the user calls <code>DiffusionPipeline.from_pretrained</code> with a local snapshot directory containing custom component files (e.g., <code>unet/my_unet_model.py</code>) referenced from <code>model_index.json</code>. The local path bypasses <code>download()</code>.</li>
<li>The attacker&rsquo;s <code>pipeline.py</code> or custom component files are loaded as dynamic modules.</li>
<li>The attacker&rsquo;s code is executed, granting the attacker arbitrary code execution privileges on the victim&rsquo;s machine.</li>
<li>The attacker can then perform various malicious activities, such as installing malware, stealing data, or compromising the system.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows for arbitrary remote code execution on the victim&rsquo;s machine. This could lead to complete system compromise, data theft, or other malicious activities. All users of diffusers versions before 0.38.0 who call <code>DiffusionPipeline.from_pretrained</code> with custom pipelines are potentially affected.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to diffusers version 0.38.0 or later to remediate the vulnerability. The fix moves the <code>trust_remote_code</code> gate to <code>get_cached_module_file</code> in <code>src/diffusers/utils/dynamic_modules_utils.py</code> (<a href="https://github.com/huggingface/diffusers/pull/13448">https://github.com/huggingface/diffusers/pull/13448</a>).</li>
<li>If upgrading is not immediately possible, only call <code>from_pretrained</code> with <code>pretrained_model_name_or_path</code>, <code>custom_pipeline</code>, and local snapshot directories from fully trusted sources that have been audited.</li>
<li>If a local snapshot is used, inspect it for unexpected <code>*.py</code> files, especially under component subdirectories (<code>unet/</code>, <code>scheduler/</code>, etc.) and at the snapshot root before calling <code>from_pretrained</code>.</li>
<li>Deploy the Sigma rule to detect execution of unexpected python files.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>remote-code-execution</category><category>diffusers</category><category>trust_remote_code</category></item></channel></rss>