CVE-2021-46669
📋 TL;DR
This CVE describes a use-after-free vulnerability in MariaDB's BIGINT data type handling that allows attackers to potentially crash the database server or execute arbitrary code. It affects MariaDB versions through 10.5.9. Database administrators running vulnerable versions should prioritize patching.
💻 Affected Systems
- MariaDB
📦 What is this software?
Fedora by Fedoraproject
Fedora by Fedoraproject
Mariadb by Mariadb
Mariadb by Mariadb
Mariadb by Mariadb
Mariadb by Mariadb
Mariadb by Mariadb
Mariadb by Mariadb
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete database compromise, data theft, or server takeover.
Likely Case
Database server crash causing denial of service and potential data corruption.
If Mitigated
Limited impact with proper network segmentation and minimal attack surface exposure.
🎯 Exploit Status
The vulnerability requires specific BIGINT data type usage to trigger. No public exploit code has been identified, but the vulnerability is remotely exploitable without authentication.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: MariaDB 10.5.10 and later
Vendor Advisory: https://mariadb.com/kb/en/security/
Restart Required: Yes
Instructions:
1. Backup your database. 2. Stop MariaDB service. 3. Upgrade to MariaDB 10.5.10 or later using your package manager. 4. Restart MariaDB service. 5. Verify the upgrade was successful.
🔧 Temporary Workarounds
Network Access Restriction
allRestrict network access to MariaDB to only trusted IP addresses and applications.
Configure firewall rules to limit MariaDB port (default 3306) access
Database User Privilege Reduction
allMinimize privileges for database users to reduce attack surface.
REVOKE unnecessary privileges from database users
🧯 If You Can't Patch
- Implement strict network segmentation and firewall rules to isolate MariaDB servers
- Monitor for unusual database crashes or performance anomalies
🔍 How to Verify
Check if Vulnerable:
Check MariaDB version: If version is 10.5.9 or earlier, the system is vulnerable.
Check Version:
mysql --version | grep -i mariadb
Verify Fix Applied:
Verify MariaDB version is 10.5.10 or later after patching.
📡 Detection & Monitoring
Log Indicators:
- Unexpected MariaDB crashes
- Error messages related to convert_const_to_int
- Segmentation fault errors in MariaDB logs
Network Indicators:
- Unusual queries involving BIGINT data types from unexpected sources
SIEM Query:
source="mariadb.log" AND ("segmentation fault" OR "convert_const_to_int" OR "use-after-free")
🔗 References
- https://jira.mariadb.org/browse/MDEV-25638
- https://lists.debian.org/debian-lts-announce/2022/09/msg00023.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FRJCSPQHYPKTWXXZVDMY6JAHZJQ4TZ5X/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KHEOTQ63YWC3PGHGDFGS7AZIEXCGOPWH/
- https://mariadb.com/kb/en/security/
- https://security.netapp.com/advisory/ntap-20220221-0002/
- https://jira.mariadb.org/browse/MDEV-25638
- https://lists.debian.org/debian-lts-announce/2022/09/msg00023.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FRJCSPQHYPKTWXXZVDMY6JAHZJQ4TZ5X/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KHEOTQ63YWC3PGHGDFGS7AZIEXCGOPWH/
- https://mariadb.com/kb/en/security/
- https://security.netapp.com/advisory/ntap-20220221-0002/