Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2023-50164 PoC — Apache Struts: File upload component had a directory traversal vulnerability

Source
Associated Vulnerability
Title:Apache Struts: File upload component had a directory traversal vulnerability (CVE-2023-50164)
Description:An attacker can manipulate file upload params to enable paths traversal and under some circumstances this can lead to uploading a malicious file which can be used to perform Remote Code Execution. Users are recommended to upgrade to versions Struts 2.5.33 or Struts 6.3.0.2 or greater to fix this issue.
Description
CVE-2023-50164 PoC Application & Exploit script
Readme
# CVE-2023-50164 PoC

This repository is a proof of concept (PoC) of the CVE-2023-50164 vulnerability.

## 1. About CVE-2023-50164

**CVE-2023-50164** is a file path traversal vulnerability that occurs in Apache Struts web application.   
An attacker could exploit this vulnerability to upload malicious file (WebShell or other Malware) to arbitrary location and make secondary attacks such as remote code execution. 

## 2. Building the Vulnerable Environment

The vulnerable web application, StrutsUploadApp, is containerized using Docker. Follow these steps to build and deploy the environment.

Use the provided `Dockerfile` to build the Docker image for `StrutsUploadApp`.

```bash
docker build -t struts-upload-app .
docker run -d -p 8080:8080 --name StrutsUploadApp struts-upload-app 
```

## 3. Exploit
Run the exploit script to trigger the vulnerability.

```bash
python exploit.py --url=http://localhost:8080/StrutsUploadApp/upload.action /
    --file=webshell.jsp /
    --file-parameter=upload /
    --attemps=5
```
File Snapshot

[4.0K] /data/pocs/283274645f13cdfb28f914c299cc4570f5778016 ├── [ 34] docker-compose.yml ├── [ 268] Dockerfile ├── [3.9K] exploit.py ├── [1.0K] README.md └── [4.0K] StrutsUploadApp ├── [ 10K] mvnw ├── [6.6K] mvnw.cmd ├── [1.9K] pom.xml └── [4.0K] src └── [4.0K] main ├── [4.0K] java │   └── [4.0K] com │   └── [4.0K] nikitapark │   └── [4.0K] app │   └── [1.7K] UploadAction.java ├── [4.0K] resources │   └── [ 776] struts.xml └── [4.0K] webapp ├── [ 270] index.jsp └── [4.0K] WEB-INF ├── [ 683] error.jsp ├── [1.0K] input.jsp ├── [ 896] success.jsp └── [ 603] web.xml 10 directories, 14 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →