CVE-2020-18886

7.2 HIGH

📋 TL;DR

This vulnerability allows remote attackers to upload arbitrary files to PHPMyWind v5.6 systems via the admin/upload_file_do.php component. Attackers can execute arbitrary code on the server by uploading malicious files like PHP shells. All PHPMyWind v5.6 installations with the vulnerable component accessible are affected.

💻 Affected Systems

Products:
  • PHPMyWind
Versions: v5.6
Operating Systems: Any OS running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Requires the admin/upload_file_do.php component to be accessible. Default installations are vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise with remote code execution leading to data theft, ransomware deployment, or creation of persistent backdoors.

🟠

Likely Case

Webshell upload leading to unauthorized access, data exfiltration, and lateral movement within the network.

🟢

If Mitigated

File upload attempts blocked or sanitized, preventing malicious file execution.

🌐 Internet-Facing: HIGH - Directly exploitable via web interface without authentication in default configurations.
🏢 Internal Only: MEDIUM - Still exploitable from internal networks but requires network access.

🎯 Exploit Status

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

Simple file upload exploitation with publicly available proof-of-concept. No authentication required in default configurations.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch available. Consider upgrading to a newer version if available, or implement workarounds.

🔧 Temporary Workarounds

Restrict file upload access

all

Block access to the vulnerable upload_file_do.php component via web server configuration or firewall rules.

# Apache: Add to .htaccess
<Files "upload_file_do.php">
    Order Allow,Deny
    Deny from all
</Files>
# Nginx: Add to server block
location ~ /admin/upload_file_do\.php$ {
    deny all;
    return 403;
}

Implement file upload validation

all

Add server-side validation to restrict uploaded file types to safe extensions only.

# Example PHP validation snippet
$allowed_extensions = array('jpg', 'jpeg', 'png', 'gif', 'pdf');
$file_extension = strtolower(pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION));
if (!in_array($file_extension, $allowed_extensions)) {
    die('Invalid file type');
}

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate PHPMyWind from critical systems.
  • Deploy web application firewall (WAF) with file upload protection rules.

🔍 How to Verify

Check if Vulnerable:

Check if /admin/upload_file_do.php exists and is accessible via HTTP requests. Test by attempting to upload a file with a PHP extension.

Check Version:

Check PHPMyWind version in configuration files or admin panel. Look for version 5.6 in source code or documentation.

Verify Fix Applied:

Verify that upload_file_do.php returns 403 Forbidden or is inaccessible. Test file upload functionality with malicious extensions to confirm blocking.

📡 Detection & Monitoring

Log Indicators:

  • HTTP POST requests to /admin/upload_file_do.php with file uploads
  • Uploads of files with .php, .phtml, or other executable extensions
  • Unusual file creation in upload directories

Network Indicators:

  • POST requests to upload endpoints with unusual file types
  • Traffic patterns indicating webshell communication

SIEM Query:

source="web_logs" AND uri="/admin/upload_file_do.php" AND (file_extension="php" OR file_extension="phtml")

🔗 References

📤 Share & Export