CVE-2022-23315

9.8 CRITICAL

📋 TL;DR

MCMS v5.2.4 contains an arbitrary file upload vulnerability in the /ms/template/writeFileContent.do endpoint that allows attackers to upload malicious files to the server. This affects all systems running MCMS v5.2.4 with the vulnerable component accessible. Attackers can exploit this to achieve remote code execution or compromise the web server.

💻 Affected Systems

Products:
  • MCMS
Versions: v5.2.4
Operating Systems: All platforms running MCMS
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the default installation of MCMS v5.2.4. Any system with this version and the template component enabled is vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full server compromise leading to data theft, ransomware deployment, or use as a pivot point into internal networks.

🟠

Likely Case

Webshell upload leading to persistent backdoor access, data exfiltration, and further system exploitation.

🟢

If Mitigated

Limited impact with proper file upload validation, restricted permissions, and network segmentation in place.

🌐 Internet-Facing: HIGH - Directly accessible web endpoint with no authentication required for exploitation.
🏢 Internal Only: HIGH - Even internal systems can be exploited by compromised internal users or lateral movement.

🎯 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. Simple HTTP POST requests can exploit this vulnerability.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v5.2.5 or later

Vendor Advisory: https://gitee.com/mingSoft/MCMS/issues/I4Q4PX

Restart Required: Yes

Instructions:

1. Backup your current MCMS installation and database. 2. Download MCMS v5.2.5 or later from the official repository. 3. Replace the vulnerable files with the patched version. 4. Restart the web application server. 5. Verify the fix by testing the vulnerable endpoint.

🔧 Temporary Workarounds

Block Vulnerable Endpoint

all

Temporarily block access to the vulnerable /ms/template/writeFileContent.do endpoint using web server configuration.

# For Apache: RewriteRule ^/ms/template/writeFileContent\.do$ - [F,L]
# For Nginx: location ~ ^/ms/template/writeFileContent\.do$ { return 403; }

Implement File Upload Restrictions

all

Configure web application firewall or server to restrict file uploads to specific extensions and validate file content.

# Example for Apache mod_security: SecRule REQUEST_URI "@contains /ms/template/writeFileContent.do" "id:1001,phase:2,deny,status:403"

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate the MCMS server from critical systems
  • Deploy a web application firewall with rules to detect and block file upload exploitation attempts

🔍 How to Verify

Check if Vulnerable:

Attempt to upload a test file to /ms/template/writeFileContent.do endpoint. If successful without proper validation, the system is vulnerable.

Check Version:

Check the MCMS version in the admin panel or examine the application's version files in the installation directory.

Verify Fix Applied:

After patching, attempt the same file upload test. The request should be rejected with proper error messages or validation failures.

📡 Detection & Monitoring

Log Indicators:

  • HTTP POST requests to /ms/template/writeFileContent.do with file upload parameters
  • Unusual file creation in web directories
  • Webshell-like file names (e.g., .jsp, .php, .aspx) in upload directories

Network Indicators:

  • Unusual outbound connections from the web server
  • HTTP requests with file upload patterns to the vulnerable endpoint

SIEM Query:

source="web_server" AND (url="/ms/template/writeFileContent.do" OR file_upload="true")

🔗 References

📤 Share & Export