<?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>Unserialize — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/unserialize/</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, 09 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/unserialize/feed.xml" rel="self" type="application/rss+xml"/><item><title>Grav CMS Multiple RCE Vulnerabilities</title><link>https://feed.craftedsignal.io/briefs/2024-01-grav-rce/</link><pubDate>Tue, 09 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-grav-rce/</guid><description>Multiple critical and high severity remote code execution vulnerabilities exist in Grav CMS due to unsafe unserialize functions, command injection in git clone, and an SSTI blocklist bypass, impacting versions prior to 2.0.0-beta.2.</description><content:encoded><![CDATA[<p>Multiple remote code execution (RCE) vulnerabilities have been identified in Grav CMS, a flat-file content management system. These vulnerabilities, including unsafe unserialize functions in JobQueue, FileCache, and Session, a command injection in git clone, and a server-side template injection (SSTI) blocklist bypass, allow attackers to execute arbitrary code on affected systems. The vulnerabilities are present in Grav CMS versions prior to 2.0.0-beta.2 and were patched in commit c66dfeb5f and 38685ac25. Successful exploitation of these vulnerabilities could lead to complete system compromise, data theft, and disruption of service. The most concerning are the unserialize issues, as they do not require admin access and can be triggered by any file write primitive.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains the ability to write files to the Grav CMS server, either through an existing vulnerability (e.g., file upload) or misconfiguration.</li>
<li>The attacker crafts a serialized PHP object containing malicious code.</li>
<li>For JobQueue or FileCache exploitation, the attacker writes this serialized object to the appropriate cache file location. For Session exploitation, the attacker sets a crafted serialized object within a session variable.</li>
<li>The Grav CMS application deserializes the crafted object using <code>unserialize()</code>, without proper input validation.</li>
<li>The deserialization process instantiates the malicious object, triggering the execution of arbitrary code. Specifically, the JobQueue vulnerability allows direct RCE via <code>Job::exec → call_user_func_array</code>.</li>
<li>For the git clone command injection, an administrator attempts to install a malicious plugin or theme. The attacker injects commands into the <code>branch</code>, <code>url</code>, or <code>path</code> parameters within the plugin&rsquo;s or theme&rsquo;s configuration.</li>
<li>The <code>InstallCommand.php</code> script executes a <code>git clone</code> command, incorporating the attacker-controlled parameters without proper sanitization.</li>
<li>The injected commands are executed on the server, granting the attacker arbitrary code execution.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of these vulnerabilities can lead to complete system compromise. An attacker could gain unauthorized access to sensitive data, modify website content, install backdoors, or use the compromised server as a launchpad for further attacks. The unserialize vulnerabilities are especially critical as they do not require administrative privileges if an attacker can write to the cache directory. The impact includes potential data theft, service disruption, and reputational damage.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade Grav CMS to version 2.0.0-beta.2 or later to patch the vulnerabilities described in this brief.</li>
<li>Implement the Sigma rule <code>Detect Unsafe PHP Unserialize</code> to identify attempts to exploit the unserialize vulnerabilities in web server logs.</li>
<li>Review and harden file upload and file management functionalities to prevent unauthorized file writes to the Grav CMS server.</li>
<li>Monitor process creation events for git commands executed by the web server user, using the Sigma rule <code>Detect Git Clone Command Injection</code>.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">threat</category><category>rce</category><category>unserialize</category><category>command-injection</category><category>ssti</category></item></channel></rss>