CVE-2022-24051

7.8 HIGH

📋 TL;DR

CVE-2022-24051 is a format string vulnerability in MariaDB's CONNECT storage engine that allows authenticated local attackers to escalate privileges and execute arbitrary code with service account permissions. The vulnerability affects MariaDB installations where the CONNECT storage engine is enabled. Attackers must have database authentication credentials to exploit this flaw.

💻 Affected Systems

Products:
  • MariaDB
Versions: MariaDB versions before 10.6.7, 10.5.8, 10.4.17, 10.3.27, and 10.2.36
Operating Systems: Linux, Windows, macOS - all platforms running affected MariaDB versions
Default Config Vulnerable: ✅ No
Notes: The CONNECT storage engine must be enabled and accessible to authenticated users. Not all MariaDB installations have this engine enabled by default.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise via arbitrary code execution as the MariaDB service account, potentially leading to database takeover, data exfiltration, and lateral movement within the network.

🟠

Likely Case

Privilege escalation within the database system allowing attackers to gain administrative database privileges, modify data, and potentially execute limited system commands.

🟢

If Mitigated

Minimal impact if proper network segmentation, least privilege access controls, and patch management are implemented, limiting the attack surface.

🌐 Internet-Facing: LOW - This requires local access and authentication, making internet-facing systems less vulnerable unless attackers have already compromised credentials.
🏢 Internal Only: MEDIUM - Internal attackers with database credentials could exploit this, but it requires authentication and local access to the database server.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires authenticated database access and knowledge of format string exploitation techniques. The vulnerability was discovered through coordinated disclosure via ZDI-CAN-16193.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: MariaDB 10.6.7, 10.5.8, 10.4.17, 10.3.27, or 10.2.36

Vendor Advisory: https://mariadb.com/kb/en/security/

Restart Required: Yes

Instructions:

1. Identify current MariaDB version. 2. Backup databases and configuration. 3. Stop MariaDB service. 4. Upgrade to patched version using package manager or manual installation. 5. Restart MariaDB service. 6. Verify successful upgrade and functionality.

🔧 Temporary Workarounds

Disable CONNECT Storage Engine

all

Prevents exploitation by disabling the vulnerable component if not required

Edit MariaDB configuration file (my.cnf or my.ini) and add: skip-connect-engine
Restart MariaDB: sudo systemctl restart mariadb

Restrict Database User Privileges

all

Limit attack surface by applying principle of least privilege to database users

REVOKE ALL PRIVILEGES ON *.* FROM 'username'@'host';
GRANT SELECT, INSERT, UPDATE, DELETE ON specific_db.* TO 'username'@'host';

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate MariaDB servers from critical systems
  • Enforce strong authentication mechanisms and regularly rotate database credentials

🔍 How to Verify

Check if Vulnerable:

Run: SELECT VERSION(); and compare against affected versions. Check if CONNECT engine is enabled with: SHOW ENGINES;

Check Version:

SELECT VERSION();

Verify Fix Applied:

Confirm version is 10.6.7, 10.5.8, 10.4.17, 10.3.27, or 10.2.36 or higher using SELECT VERSION();

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries involving CONNECT engine functions
  • Multiple failed authentication attempts followed by successful login
  • Privilege escalation attempts in database logs

Network Indicators:

  • Unusual database connection patterns from unexpected sources
  • SQL injection-like patterns in database traffic

SIEM Query:

source="mariadb.log" AND ("CONNECT" OR "format string" OR "privilege escalation")

🔗 References

📤 Share & Export