info: name: Apache Struts Arbitrary File Upload RCE (DAST) - CVE-2023-50164 author: Dev Bui Hieu severity: critical description: | Apache Struts versions before 2.5.33 and 6.3.0.2 are vulnerable to CVE-2023-50164, allowing attackers to write files to arbitrary locations via path traversal during file upload.
This is a DAST-style template, designed for dynamic scanning when full upload endpoints are known. You must provide the full upload endpoint URL when running this template, for example: nuclei -t cve-2023-50164.yaml -u http://target.com/upload.action
If vulnerable, this template attempts to upload a JSP file containing a unique marker string. It then verifies execution by visiting the uploaded JSP file directly.
remediation: | Update to Apache Struts 2.5.33or6.3.0.2 (or later), where the vulnerability has been patched. Avoid using user-supplied file paths for file uploads and validate file paths server-side.