CVE-2023-31689

9.8 CRITICAL

📋 TL;DR

This vulnerability in Wcms 0.3.2 allows unauthenticated attackers to upload arbitrary files and execute malicious code through crafted requests to the /wcms/wex/html.php endpoint. Attackers can achieve remote command execution by exploiting improper input validation in the finish and textAreaCode parameters. Anyone running Wcms 0.3.2 with the vulnerable component accessible is affected.

💻 Affected Systems

Products:
  • Wcms
Versions: 0.3.2
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the default installation of Wcms 0.3.2. Any system with the /wcms/wex/html.php endpoint accessible is vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise allowing attackers to execute arbitrary commands, steal data, install persistent backdoors, and pivot to other systems in the network.

🟠

Likely Case

Remote code execution leading to web server compromise, data exfiltration, and potential lateral movement within the network.

🟢

If Mitigated

Limited impact if proper network segmentation, web application firewalls, and file upload restrictions are in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

The vulnerability requires no authentication and has publicly available proof-of-concept code, making exploitation trivial for attackers.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: https://github.com/vedees/wcms/issues/15

Restart Required: No

Instructions:

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

🔧 Temporary Workarounds

Block vulnerable endpoint

all

Restrict access to the /wcms/wex/html.php endpoint using web server configuration or firewall rules.

# Apache: RewriteRule ^/wcms/wex/html\.php$ - [F]
# Nginx: location ~ ^/wcms/wex/html\.php$ { deny all; }

Implement file upload restrictions

all

Configure web application firewall or server to block file uploads with dangerous extensions and validate all uploads.

# Example mod_security rule: SecRule FILES_TMPNAMES "@rx \.(php|phtml|phar|inc)$" "deny,status:403"

🧯 If You Can't Patch

  • Isolate the Wcms instance in a segmented network zone with strict outbound firewall rules
  • Implement comprehensive monitoring and alerting for suspicious file uploads and command execution attempts

🔍 How to Verify

Check if Vulnerable:

Check if Wcms version is 0.3.2 and if /wcms/wex/html.php endpoint is accessible. Test with a harmless payload to confirm vulnerability.

Check Version:

Check Wcms configuration files or admin panel for version information

Verify Fix Applied:

Verify that the vulnerable endpoint is no longer accessible or that file upload restrictions are properly enforced.

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to /wcms/wex/html.php with finish and textAreaCode parameters
  • File uploads with suspicious extensions to Wcms directories
  • System command execution from web server process

Network Indicators:

  • Outbound connections from web server to suspicious IPs or command-and-control servers
  • Unusual traffic patterns from Wcms instance

SIEM Query:

source="web_server_logs" AND (uri="/wcms/wex/html.php" AND (param="finish" OR param="textAreaCode"))

🔗 References

📤 Share & Export