Apache Struts S2-066 File Upload Path Traversal RCE
CVE-2023-50164, tracked by Apache Struts as S2-066, is a path-traversal vulnerability in Apache Struts file-upload handling. Improper processing of attacker-controlled upload filename parameters can permit traversal outside the intended upload location and arbitrary file writes. Under deployment-specific conditions, an attacker can use this behavior to upload a malicious server-side file, such as a JSP web shell, to a web-accessible location and execute code on the affected server. Affected releases include Struts 2.0.0 through 2.3.37, 2.5.0 through 2.5.32, and 6.0.0 through 6.3.0.1.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation can allow an attacker to write a malicious server-side file outside the intended upload directory. If that file is placed at a valid remotely reachable route and executed by the application server, the attacker can obtain arbitrary code execution on the affected Struts server, including the ability to deploy a web shell.
If you can’t patch tonight, do this now.
Until fixed versions can be deployed, restrict Internet and untrusted-network access to web interfaces that expose Struts upload functionality. Place a web application firewall in front of exposed interfaces and monitor application servers for unexpected JSP file creation or execution, especially in sensitive or web-accessible directories.
Patch, then assume compromise.
Upgrade Apache Struts to version 2.5.33 or later for the 2.5.x branch, or version 6.3.0.2 or later for the 6.x branch. The fixed releases are intended as drop-in replacements.
8 exploits validated by Mallory's analysis. Hidden: 1 rejected by Mallory's analysis as not a working exploit.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
17 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.