<?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>Phar Deserialization — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/phar-deserialization/</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>Tue, 21 Apr 2026 14:32:48 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/phar-deserialization/feed.xml" rel="self" type="application/rss+xml"/><item><title>OpenMage LTS Phar Deserialization RCE</title><link>https://feed.craftedsignal.io/briefs/2024-01-openmage-phar-deserialization/</link><pubDate>Tue, 21 Apr 2026 14:32:48 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-openmage-phar-deserialization/</guid><description>A remote code execution vulnerability exists in OpenMage LTS versions prior to 20.16.1 due to Phar deserialization, where an attacker can upload a malicious phar file disguised as an image and trigger deserialization via functions like `getimagesize()`, `file_exists()`, or `is_readable()` when processing `phar://` stream wrapper paths, leading to arbitrary code execution.</description><content:encoded><![CDATA[<p>OpenMage LTS versions prior to 20.16.1 are vulnerable to remote code execution due to insecure handling of PHP archives (phar) and the <code>phar://</code> stream wrapper. The vulnerability stems from the usage of functions like <code>getimagesize()</code>, <code>file_exists()</code>, and <code>is_readable()</code> with potentially controllable file paths in image validation and media handling. An attacker can exploit this by uploading a specially crafted polyglot file (a valid image that is also a valid phar archive) and then triggering the vulnerable functions to access it using the <code>phar://</code> protocol, resulting in the deserialization of malicious code. This issue affects any versions derived from Magento 1.x with the vulnerable code paths in <code>app/code/core/Mage/Core/Model/File/Validator/Image.php</code>, <code>app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php</code>, and <code>lib/Varien/Image.php</code>.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker crafts a polyglot file that is both a valid image (e.g., JPEG) and a valid PHP archive (phar).</li>
<li>The malicious phar archive contains serialized PHP objects designed to execute arbitrary code when deserialized.</li>
<li>The attacker uploads the polyglot file to the OpenMage LTS server through a vulnerable endpoint, such as product images, CMS media, or file import functionality.</li>
<li>The application stores the uploaded file in a publicly accessible directory.</li>
<li>The attacker triggers the vulnerable application logic in <code>app/code/core/Mage/Core/Model/File/Validator/Image.php</code> (line 72), <code>app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php</code> (line 137) or <code>lib/Varien/Image.php</code> (line 71), causing the application to use <code>getimagesize()</code> or similar functions on the uploaded file with the <code>phar://</code> stream wrapper.</li>
<li>PHP attempts to read the file using the <code>phar://</code> wrapper, which triggers the deserialization of the malicious metadata contained within the phar archive.</li>
<li>The deserialization process instantiates the malicious PHP objects, executing the attacker&rsquo;s code.</li>
<li>The attacker achieves remote code execution on the server, allowing them to compromise the system, install malware, or exfiltrate data.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows an attacker to execute arbitrary code on the OpenMage LTS server. This can lead to complete system compromise, data theft, defacement of the website, or the installation of malware. Given the potential for unauthenticated file uploads, the impact is significant, with potential widespread compromise affecting all versions of OpenMage LTS prior to 20.16.1. The vulnerability exists in core Magento 1.x code, so all derived products are affected.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade OpenMage LTS to version 20.16.1 or later to patch the vulnerability.</li>
<li>Implement the recommended code fix by blocking <code>phar://</code> paths before passing to vulnerable functions like <code>getimagesize()</code> in the affected files: <code>app/code/core/Mage/Core/Model/File/Validator/Image.php</code>, <code>app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php</code>, and <code>lib/Varien/Image.php</code>.</li>
<li>Deploy the Sigma rule to detect attempts to access files using the <code>phar://</code> stream wrapper (see rule &ldquo;Detect Phar Stream Wrapper Access&rdquo;).</li>
<li>If upgrading is not immediately possible, disable the <code>phar://</code> stream wrapper in the <code>php.ini</code> file.</li>
<li>Implement strict upload validation beyond file extension checks to prevent the upload of polyglot files.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>phar deserialization</category><category>remote code execution</category><category>OpenMage LTS</category><category>Magento 1.x</category></item></channel></rss>