<?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>Struts 2 — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/struts-2/</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>Fri, 05 Jan 2024 18:22:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/struts-2/feed.xml" rel="self" type="application/rss+xml"/><item><title>Apache Struts CVE-2023-50164 Exploitation Leading to Web Shell Deployment</title><link>https://feed.craftedsignal.io/briefs/2024-01-apache-struts-cve-2023-50164-webshell/</link><pubDate>Fri, 05 Jan 2024 18:22:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-apache-struts-cve-2023-50164-webshell/</guid><description>Exploitation of CVE-2023-50164, a critical path traversal vulnerability in Apache Struts 2, is detected by identifying malicious multipart/form-data POST requests with WebKitFormBoundary targeting Struts .action upload endpoints, followed by JSP web shell creation in Tomcat's webapps directories, indicating remote code execution.</description><content:encoded><![CDATA[<p>CVE-2023-50164 is a critical path traversal vulnerability affecting Apache Struts 2 versions prior to 2.5.33 or 6.3.0.2. The vulnerability resides in the file upload functionality, allowing attackers to manipulate file upload parameters and write malicious files, such as JSP web shells, to arbitrary locations on the web server. Successful exploitation leads to remote code execution. Detection focuses on correlating suspicious file upload requests to Struts endpoints with subsequent creation of JSP files in web-accessible directories, indicating successful exploitation. The attack involves crafting malicious multipart/form-data POST requests with WebKitFormBoundary to Struts .action upload endpoints.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker sends a malicious HTTP POST request to a vulnerable Apache Struts endpoint (e.g., <code>*.action</code>).</li>
<li>The HTTP POST request contains a <code>multipart/form-data</code> content type with a <code>WebKitFormBoundary</code> string.</li>
<li>The request exploits CVE-2023-50164, leveraging a path traversal vulnerability in the file upload process.</li>
<li>The attacker bypasses security controls due to the path traversal vulnerability.</li>
<li>The attacker uploads a malicious JSP file (web shell) to a web-accessible directory, such as Tomcat&rsquo;s <code>webapps</code> directory.</li>
<li>A Java process (e.g., Tomcat) creates the JSP web shell file in the webapps directory.</li>
<li>The attacker accesses the deployed web shell via HTTP.</li>
<li>The attacker executes arbitrary commands on the server through the web shell.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of CVE-2023-50164 allows attackers to achieve remote code execution on the affected server. This can lead to complete system compromise, data exfiltration, deployment of malware, and lateral movement within the network. The vulnerability affects Apache Struts 2 applications using the file upload feature, potentially impacting numerous organizations across various sectors using the framework.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule &ldquo;Apache Struts CVE-2023-50164 Webshell Creation&rdquo; to detect JSP file creation events in webapps directories following suspicious POST requests as described in the overview.</li>
<li>Deploy the Sigma rule &ldquo;Apache Struts CVE-2023-50164 Suspicious POST Request&rdquo; to detect suspicious POST requests to Struts endpoints with <code>multipart/form-data</code> content containing <code>WebKitFormBoundary</code>, as indicated in the Attack Chain.</li>
<li>Patch Apache Struts 2 to version 2.5.33, 6.3.0.2, or higher to remediate the CVE-2023-50164 vulnerability, as noted in the References.</li>
<li>Enable HTTP request body capture in network traffic monitoring tools to detect the multipart/form-data content containing WebKitFormBoundary indicators, as required by the rule setup.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>apache-struts</category><category>webshell</category><category>cve-2023-50164</category><category>initial-access</category><category>persistence</category><category>command-and-control</category></item></channel></rss>