<?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>Stanza (&lt;= 1.12.1) - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/stanza--1.12.1/</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>Fri, 19 Jun 2026 19:36:57 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/stanza--1.12.1/feed.xml" rel="self" type="application/rss+xml"/><item><title>Stanza: Remote Code Execution via Unsafe Pickle Deserialization in Model Loaders</title><link>https://feed.craftedsignal.io/briefs/2026-06-stanza-rce/</link><pubDate>Fri, 19 Jun 2026 19:36:57 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-06-stanza-rce/</guid><description>Stanza, an NLP library, is vulnerable to remote code execution (CVE-2026-54499) due to an unsafe fallback mechanism when loading PyTorch model files, allowing an attacker who can place a malicious pretrain or model file to achieve arbitrary code execution on systems processing NLP pipelines, leading to credential theft, backdoors, data exfiltration, and lateral movement.</description><content:encoded><![CDATA[<p>The Stanza Natural Language Processing (NLP) library, specifically version 1.12.0 and earlier, is susceptible to an arbitrary code execution vulnerability (CVE-2026-54499) stemming from unsafe deserialization. When attempting to load PyTorch checkpoint files, Stanza's <code>torch.load</code> implementation initially uses a <code>weights_only=True</code> flag for safety. However, if this safe load raises a <code>pickle.UnpicklingError</code> (a condition controllable by an attacker via a specially crafted <code>.pt</code> file containing an unsupported pickle global), Stanza immediately falls back to reloading the <em>same attacker-controlled file</em> with <code>weights_only=False</code>. This completely bypasses PyTorch's safety mechanisms, invoking Python's full pickle deserializer, which can execute any <code>__reduce__</code> method embedded in the malicious file. The vulnerability affects any user, researcher, or NLP service loading Stanza models from untrusted or compromised sources, enabling full system compromise.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li><strong>Attacker Crafts Malicious Model</strong>: An attacker prepares a malicious PyTorch <code>.pt</code> file, embedding arbitrary Python code in its <code>__reduce__</code> method and including at least one unsupported pickle global to force an <code>UnpicklingError</code> during safe loading.</li>
<li><strong>Model Placement/Distribution</strong>: The attacker places this malicious <code>.pt</code> file on a system or repository where it can be loaded by a victim (e.g., via supply-chain compromise of a model repository like HuggingFace, poisoning a shared model cache, or distributing it through third-party fine-tuning hubs).</li>
<li><strong>Victim Initiates Model Load</strong>: A victim's application, CI/CD pipeline, or research environment uses the Stanza API (<code>stanza.Pipeline()</code>, <code>load_pretrain()</code>) to load a pretrain or model file, unknowingly targeting the malicious <code>.pt</code> file.</li>
<li><strong>Initial Safe Load Attempt</strong>: Stanza's internal <code>Pretrain.load()</code> function attempts to load the <code>.pt</code> file using <code>torch.load(..., weights_only=True)</code>.</li>
<li><strong>UnpicklingError Triggered</strong>: Due to the attacker-controlled unsupported pickle global, PyTorch raises a <code>pickle.UnpicklingError</code> as intended by its <code>weights_only=True</code> safety feature.</li>
<li><strong>Unsafe Fallback Invoked</strong>: Stanza's vulnerable <code>try...except</code> block catches the <code>UnpicklingError</code> and immediately reloads the <em>same malicious file</em> using <code>torch.load(..., weights_only=False)</code>.</li>
<li><strong>Arbitrary Code Execution</strong>: Python's full pickle deserializer executes the attacker's arbitrary code embedded within the malicious <code>.pt</code> file's <code>__reduce__</code> method, with the privileges of the Stanza process.</li>
<li><strong>Impact Achieved</strong>: The attacker's payload executes, leading to consequences such as credential theft (HuggingFace tokens, cloud IAM keys), installation of persistent backdoors, data exfiltration, or lateral movement within the victim's infrastructure.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>This vulnerability, classified as CWE-502 (Deserialization of Untrusted Data), has severe consequences for any user, researcher, CI/CD pipeline, or production NLP service that loads a Stanza model pretrain file from sources not under exclusive cryptographic control. Attackers who can place a malicious <code>.pt</code> file can achieve arbitrary code execution with the full privileges of the process running <code>stanza.Pipeline()</code>. This can be a developer workstation, a Jupyter notebook server, or a GPU training node, potentially leading to credential theft (e.g., HuggingFace tokens, cloud IAM keys from environment variables), persistent backdoors, data exfiltration, and lateral movement in multi-tenant training infrastructure. The vulnerability affects Stanza versions up to and including 1.12.1.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade Stanza to a patched version immediately (version 1.12.2 or higher) to mitigate CVE-2026-54499, which removes the unsafe fallback for <code>pickle.UnpicklingError</code>.</li>
<li>Review and ensure all Stanza loaders, including those in <code>stanza/models/common/pretrain.py</code>, <code>stanza/models/coref/model.py</code>, <code>stanza/models/classifiers/trainer.py</code>, and <code>stanza/models/constituency/base_trainer.py</code>, have the unsafe fallback removed.</li>
<li>Deploy the provided Sigma rules to detect suspicious process creation and file modifications indicative of successful exploitation of CVE-2026-54499.</li>
<li>Enable comprehensive logging for <code>process_creation</code> and <code>file_event</code> on Linux and Windows systems where Stanza is used.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>deserialization</category><category>rce</category><category>python</category><category>pytorch</category><category>machine-learning</category><category>supply-chain</category><category>cwe-502</category><category>nlp</category><category>ghsa</category></item></channel></rss>