CVE-2024-4500

6.3 MEDIUM

📋 TL;DR

This critical vulnerability in SourceCodester Prison Management System 1.0 allows attackers to upload arbitrary files via the /Employee/edit-photo.php endpoint. The unrestricted file upload can lead to remote code execution, compromising the entire system. Organizations using this prison management software are affected.

💻 Affected Systems

Products:
  • SourceCodester Prison Management System
Versions: 1.0
Operating Systems: Any OS running the web application
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the specific version 1.0 of the Prison Management System. The vulnerability exists in the default installation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise with attacker gaining complete control over the prison management system, accessing sensitive prisoner data, modifying records, and potentially using the system as a foothold for further network attacks.

🟠

Likely Case

Webshell deployment leading to data theft, system manipulation, and potential ransomware deployment affecting prison operations and sensitive data.

🟢

If Mitigated

Limited impact with proper file upload validation and web application firewall rules blocking malicious upload attempts.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploit details are publicly available on GitHub. Attack requires access to the Employee photo upload functionality.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: None available

Restart Required: No

Instructions:

No official patch available. Consider implementing workarounds or replacing the software.

🔧 Temporary Workarounds

Web Application Firewall Rule

all

Block access to /Employee/edit-photo.php endpoint

# Example for Apache: RewriteRule ^/Employee/edit-photo\.php$ - [F,L]
# Example for Nginx: location ~ ^/Employee/edit-photo\.php$ { deny all; }

File Upload Validation

all

Implement server-side file type validation and restrict uploads to specific directories

# Implement PHP validation: check file extension, MIME type, and content

🧯 If You Can't Patch

  • Isolate the Prison Management System from other network segments
  • Implement strict access controls and monitor all file upload activities

🔍 How to Verify

Check if Vulnerable:

Attempt to upload a file with malicious extension (e.g., .php) to /Employee/edit-photo.php endpoint

Check Version:

Check application version in admin panel or configuration files

Verify Fix Applied:

Test that file upload validation now properly restricts file types and extensions

📡 Detection & Monitoring

Log Indicators:

  • Unusual file uploads to /Employee/edit-photo.php
  • Uploads of non-image file types
  • Multiple failed upload attempts

Network Indicators:

  • POST requests to /Employee/edit-photo.php with suspicious file names
  • Traffic patterns indicating webshell communication

SIEM Query:

source="web_server" AND (uri="/Employee/edit-photo.php" AND (file_extension="php" OR file_extension="jsp" OR file_extension="asp"))

🔗 References

📤 Share & Export