CVE-2022-23329

9.8 CRITICAL

📋 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

Products:
  • UJCMS Jspxcms
Versions: v10.2.0 (specific version mentioned, but earlier versions may also be vulnerable)
Operating Systems: Any OS running Java/JSP applications
Default Config Vulnerable: ⚠️ Yes
Notes: Requires file upload functionality to be enabled and accessible. The vulnerability exploits FreeMarker's Execute class through template processing.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: HIGH - Web applications with file upload functionality are directly exposed to exploitation attempts.
🏢 Internal Only: MEDIUM - Internal users could exploit if they have upload privileges, but external attack surface is reduced.

🎯 Exploit Status

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

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

all

Temporarily disable file upload functionality in Jspxcms to prevent exploitation.

Modify Jspxcms configuration to remove or restrict upload features

Input Validation Filter

all

Implement 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*")

🔗 References

📤 Share & Export