<?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>Cms (&lt; 5.9.18) — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/cms--5.9.18/</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, 02 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/cms--5.9.18/feed.xml" rel="self" type="application/rss+xml"/><item><title>Craft CMS Authenticated Remote Code Execution via Malicious Attached Behavior</title><link>https://feed.craftedsignal.io/briefs/2024-01-craft-cms-rce/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-craft-cms-rce/</guid><description>Craft CMS versions before 4.17.12 and 5.9.18 are vulnerable to authenticated remote code execution via malicious behavior injection in the field layout hydration path.</description><content:encoded><![CDATA[<p>Craft CMS versions before 4.17.12 and 5.9.18 are vulnerable to authenticated remote code execution. The vulnerability stems from an input-handling flaw in a Yii object creation path, allowing any authenticated user to inject malicious configuration and execute arbitrary commands on the server. This is achieved by exploiting the dynamic object configuration feature of Yii, which Craft CMS utilizes to build parts of itself from a settings list. This vulnerability is related to a previously disclosed issue (GHSA-255j-qw47-wjh5) but utilizes a different, unmitigated path. The attack exploits the condition field layouts data conversion to a live FieldLayout object without proper sanitization.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An authenticated user logs into the Craft CMS admin panel.</li>
<li>The attacker crafts a malicious POST request to <code>/admin/actions/element-search/search</code> with a JSON payload.</li>
<li>The JSON payload contains a <code>condition</code> parameter with a nested <code>fieldLayouts</code> array.</li>
<li>Within the <code>fieldLayouts</code> array, the attacker injects a <code>yii\\behaviors\\AttributeTypecastBehavior</code> object with a <code>__construct()</code> method.</li>
<li>The <code>__construct()</code> method contains the malicious configuration, including <code>attributeTypes</code> and <code>typecastBeforeSave</code> parameters.</li>
<li>The <code>typecastBeforeSave</code> parameter is configured to execute a shell command (e.g., using <code>/bin/bash -c</code>).</li>
<li>The server-side application processes the request and attempts to create a FieldLayout object from the provided configuration data.</li>
<li>Due to the lack of sanitization, the malicious configuration is injected during object creation, leading to the execution of the attacker-controlled command.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows an attacker to execute arbitrary commands on the server with the privileges of the web server user. This can lead to complete compromise of the Craft CMS instance, including data theft, modification, or deletion. An attacker could also pivot to other systems on the network from the compromised server. There is no specific victim count or sector targeted mentioned, but any Craft CMS instance using a vulnerable version is susceptible.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade Craft CMS to version 4.17.12 or 5.9.18 or later to patch the vulnerability (Affected products).</li>
<li>Deploy the Sigma rule <code>Detect Craft CMS RCE Attempt via Element Search</code> to identify exploitation attempts in web server logs (rules).</li>
<li>Monitor POST requests to <code>/admin/actions/element-search/search</code> for suspicious JSON payloads, particularly those containing <code>yii\\behaviors\\AttributeTypecastBehavior</code> (Attack Chain).</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>craft-cms</category><category>rce</category><category>vulnerability</category></item></channel></rss>