CVE-2022-27163

9.8 CRITICAL

📋 TL;DR

CVE-2022-27163 is a critical SQL injection vulnerability in CSZ CMS 1.2.2 that allows attackers to execute arbitrary SQL commands through the admin user edit functionality. This affects all systems running vulnerable versions of CSZ CMS with the admin panel accessible. Attackers can potentially compromise the entire database and application.

💻 Affected Systems

Products:
  • CSZ CMS
Versions: 1.2.2 and possibly earlier versions
Operating Systems: All operating systems running PHP
Default Config Vulnerable: ⚠️ Yes
Notes: Requires admin panel access, but SQL injection can be exploited through various attack vectors including cross-site request forgery.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to data theft, privilege escalation, remote code execution, and full system takeover.

🟠

Likely Case

Database extraction of sensitive information including user credentials, admin access, and potential website defacement.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and network segmentation in place.

🌐 Internet-Facing: HIGH - Admin panels are often exposed to the internet, making exploitation straightforward.
🏢 Internal Only: MEDIUM - Internal attackers or compromised internal systems could exploit this vulnerability.

🎯 Exploit Status

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

Exploitation requires admin panel access, but SQL injection payloads are well-documented and easy to craft.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check latest CSZ CMS version or commit fixes

Vendor Advisory: https://github.com/cskaza/cszcms/issues/45

Restart Required: No

Instructions:

1. Update to latest CSZ CMS version. 2. Apply input validation and parameterized queries to cszcms_admin_Users_editUser function. 3. Review and sanitize all user inputs in admin panel.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement strict input validation and parameterized queries for all user inputs in admin functions

Modify PHP code to use prepared statements: $stmt = $db->prepare('UPDATE users SET name = ? WHERE id = ?'); $stmt->bind_param('si', $name, $id);

Admin Panel Access Restriction

linux

Restrict access to admin panel using IP whitelisting and strong authentication

Add to .htaccess: Order Deny,Allow
Deny from all
Allow from 192.168.1.0/24

🧯 If You Can't Patch

  • Implement web application firewall (WAF) rules to block SQL injection patterns
  • Disable or restrict access to the vulnerable admin user edit functionality

🔍 How to Verify

Check if Vulnerable:

Check if running CSZ CMS version 1.2.2 or earlier and review code for lack of parameterized queries in admin user edit functions

Check Version:

Check CSZ CMS configuration files or admin panel for version information

Verify Fix Applied:

Test admin user edit functionality with SQL injection payloads and verify they are blocked or sanitized

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple failed login attempts to admin panel
  • Suspicious POST requests to admin user edit endpoints

Network Indicators:

  • SQL injection patterns in HTTP requests to admin panel
  • Unusual database connection patterns from web server

SIEM Query:

source="web_logs" AND (uri="/admin/users/edit" OR uri="*cszcms_admin_Users_editUser*") AND (payload="' OR '1'='1" OR payload="UNION SELECT" OR payload="--" OR payload=";")

🔗 References

📤 Share & Export