CVE-2024-8332

6.3 MEDIUM

📋 TL;DR

This CVE describes a critical SQL injection vulnerability in master-nan Sweet-CMS that allows remote attackers to execute arbitrary SQL commands through the /table/index endpoint. The vulnerability affects all versions up to commit 5f441e022b8876f07cde709c77b5be6d2f262e3f. Organizations using Sweet-CMS with internet-facing deployments are at immediate risk.

💻 Affected Systems

Products:
  • master-nan Sweet-CMS
Versions: All versions up to commit 5f441e022b8876f07cde709c77b5be6d2f262e3f
Operating Systems: All platforms running Sweet-CMS
Default Config Vulnerable: ⚠️ Yes
Notes: This product uses rolling releases, so specific version numbers are not available. The vulnerability exists in the default configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data theft, data manipulation, and potential remote code execution through database functions.

🟠

Likely Case

Unauthorized data access, data exfiltration, and potential privilege escalation within the application.

🟢

If Mitigated

Limited impact with proper input validation and database permissions, potentially only read-only access to non-sensitive data.

🌐 Internet-Facing: HIGH - Remote exploitation without authentication makes internet-facing instances extremely vulnerable.
🏢 Internal Only: MEDIUM - Still exploitable by internal attackers or through compromised internal systems.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

SQL injection vulnerabilities are typically easy to exploit with basic tools. The remote unauthenticated nature makes this particularly dangerous.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Commit 146359646a5a90cb09156dbd0013b7df77f2aa6c

Vendor Advisory: https://github.com/master-nan/sweet-cms/commit/146359646a5a90cb09156dbd0013b7df77f2aa6c

Restart Required: Yes

Instructions:

1. Pull the latest code from the Sweet-CMS repository. 2. Apply commit 146359646a5a90cb09156dbd0013b7df77f2aa6c. 3. Restart the Sweet-CMS application. 4. Verify the fix by testing the /table/index endpoint.

🔧 Temporary Workarounds

Web Application Firewall (WAF)

all

Deploy a WAF with SQL injection protection rules to block malicious requests.

Input Validation Filter

all

Implement custom input validation to sanitize all parameters passed to /table/index endpoint.

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate Sweet-CMS instances from sensitive systems.
  • Deploy database-level protections including minimal privilege accounts and query whitelisting.

🔍 How to Verify

Check if Vulnerable:

Test the /table/index endpoint with SQL injection payloads like ' OR '1'='1 and monitor for unexpected database responses.

Check Version:

git log --oneline | head -5

Verify Fix Applied:

Verify that commit 146359646a5a90cb09156dbd0013b7df77f2aa6c is present in your codebase and test SQL injection attempts against the patched endpoint.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in application logs
  • Multiple failed login attempts from single IP
  • Requests to /table/index with SQL keywords

Network Indicators:

  • Unusual database connection patterns
  • Large data transfers from application server

SIEM Query:

source="sweet-cms.log" AND ("table/index" AND ("UNION" OR "SELECT" OR "INSERT" OR "DELETE"))

🔗 References

📤 Share & Export