CVE-2024-46640

9.8 CRITICAL

📋 TL;DR

SeaCMS 13.2 contains a remote code execution vulnerability in sql.class.chp where a security check function is bypassed during execution. Attackers can exploit this by writing malicious code through MySQL slow query logs, allowing them to execute arbitrary commands on the server. All SeaCMS 13.2 installations with default configurations are affected.

💻 Affected Systems

Products:
  • SeaCMS
Versions: 13.2
Operating Systems: All operating systems running SeaCMS
Default Config Vulnerable: ⚠️ Yes
Notes: Requires MySQL database with slow query logging enabled or ability to enable it.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise allowing attackers to execute arbitrary code, steal data, install backdoors, pivot to other systems, and maintain persistent access.

🟠

Likely Case

Webshell deployment leading to data theft, defacement, cryptocurrency mining, or ransomware deployment.

🟢

If Mitigated

Limited impact with proper network segmentation, minimal privileges, and active monitoring detecting exploitation attempts.

🌐 Internet-Facing: HIGH - Web applications are directly accessible and vulnerable to unauthenticated exploitation.
🏢 Internal Only: MEDIUM - Internal systems could be compromised through lateral movement or insider threats.

🎯 Exploit Status

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

Exploit details and proof-of-concept are publicly available on Gitee. The vulnerability is straightforward to exploit with basic web application testing skills.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch available. Upgrade to a newer version if available, or apply workarounds immediately.

🔧 Temporary Workarounds

Disable MySQL Slow Query Logging

all

Prevent exploitation by disabling MySQL slow query logging which is required for the attack vector.

SET GLOBAL slow_query_log = 'OFF';
FLUSH LOGS;

Restrict File Permissions

linux

Set strict permissions on sql.class.chp and related SeaCMS files to prevent unauthorized writes.

chmod 644 /path/to/seacms/sql.class.chp
chown www-data:www-data /path/to/seacms/sql.class.chp

🧯 If You Can't Patch

  • Implement web application firewall (WAF) rules to block suspicious SQL and file write attempts
  • Isolate SeaCMS instance in a segmented network with strict outbound traffic controls

🔍 How to Verify

Check if Vulnerable:

Check if running SeaCMS version 13.2 by examining version files or admin panel. Review sql.class.chp for missing security checks.

Check Version:

grep -r '13.2' /path/to/seacms/ or check admin panel at /admin/

Verify Fix Applied:

Test if MySQL slow query logging is disabled and file permissions are properly restricted. Attempt to trigger the vulnerability in a controlled environment.

📡 Detection & Monitoring

Log Indicators:

  • Unusual MySQL slow query log entries containing PHP code
  • Unexpected file writes to sql.class.chp
  • Web server logs showing POST requests to vulnerable endpoints

Network Indicators:

  • HTTP requests with SQL payloads targeting SeaCMS endpoints
  • Outbound connections from web server to suspicious IPs

SIEM Query:

source="web_logs" AND (url="*sql.class.chp*" OR method="POST" AND user_agent="*sql*" AND status=200)

🔗 References

📤 Share & Export