CVE-2022-23329
📋 TL;DR
This vulnerability in UJCMS Jspxcms allows attackers to execute arbitrary system commands by uploading malicious files that exploit a dangerous FreeMarker template function. Any organization running vulnerable versions of Jspxcms is affected, particularly those with file upload functionality exposed to users.
💻 Affected Systems
- UJCMS Jspxcms
📦 What is this software?
Jspxcms by Ujcms
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise leading to data theft, ransomware deployment, or use as a foothold for lateral movement within the network.
Likely Case
Remote code execution leading to web server compromise, data exfiltration, or installation of backdoors.
If Mitigated
Limited impact if file uploads are restricted to trusted users and input validation is enforced.
🎯 Exploit Status
Exploitation involves uploading a malicious file containing FreeMarker template code that calls the Execute function. Public references demonstrate the vulnerability.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Check vendor for updated version beyond v10.2.0
Vendor Advisory: https://gitee.com/jspxcms/Jspxcms/issues/I4QAZN
Restart Required: Yes
Instructions:
1. Check vendor advisory for patched version. 2. Backup current installation. 3. Apply vendor-provided patch or upgrade to fixed version. 4. Restart application server. 5. Verify fix implementation.
🔧 Temporary Workarounds
Disable File Uploads
allTemporarily disable file upload functionality in Jspxcms to prevent exploitation.
Modify Jspxcms configuration to remove or restrict upload features
Input Validation Filter
allImplement server-side validation to block FreeMarker Execute function calls in uploaded content.
Add content filtering rules in web application firewall or application code
🧯 If You Can't Patch
- Implement strict file upload restrictions (whitelist allowed file types, limit file size)
- Deploy web application firewall with rules to detect and block FreeMarker Execute patterns
🔍 How to Verify
Check if Vulnerable:
Check if running Jspxcms v10.2.0 and test if file uploads process FreeMarker templates with Execute function.
Check Version:
Check Jspxcms version in application interface or configuration files
Verify Fix Applied:
Verify patched version is installed and test that malicious FreeMarker Execute templates no longer execute commands.
📡 Detection & Monitoring
Log Indicators:
- Unusual file uploads with FreeMarker template content
- System command execution from web application process
- Failed upload attempts with suspicious patterns
Network Indicators:
- HTTP POST requests with file uploads containing FreeMarker syntax
- Outbound connections from web server to unexpected destinations
SIEM Query:
source="web_server" AND (url="*upload*" AND content="*freemarker.template.utility.Execute*" OR cmd="*" OR process="*cmd*" OR process="*sh*")