CVE-2022-24051
📋 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
- MariaDB
📦 What is this software?
Fedora by Fedoraproject
Fedora by Fedoraproject
Fedora by Fedoraproject
Mariadb by Mariadb
Mariadb by Mariadb
Mariadb by Mariadb
Mariadb by Mariadb
Mariadb by Mariadb
Mariadb by Mariadb
Mariadb by Mariadb
⚠️ 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.
🎯 Exploit Status
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
allPrevents 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
allLimit 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
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DKJRBYJAQCOPHSED43A3HUPNKQLDTFGD/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/EZFZVMJL5UDTOZMARLXQIMG3BTG6UNYW/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NJ4KDAGF3H4D4BDTHRAM6ZEAJJWWMRUO/
- https://mariadb.com/kb/en/security/
- https://security.netapp.com/advisory/ntap-20220318-0004/
- https://www.zerodayinitiative.com/advisories/ZDI-22-318/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DKJRBYJAQCOPHSED43A3HUPNKQLDTFGD/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/EZFZVMJL5UDTOZMARLXQIMG3BTG6UNYW/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NJ4KDAGF3H4D4BDTHRAM6ZEAJJWWMRUO/
- https://mariadb.com/kb/en/security/
- https://security.netapp.com/advisory/ntap-20220318-0004/
- https://www.zerodayinitiative.com/advisories/ZDI-22-318/