CVE-2021-46669

7.5 HIGH

📋 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

Products:
  • MariaDB
Versions: MariaDB through version 10.5.9
Operating Systems: All operating systems running affected MariaDB versions
Default Config Vulnerable: ⚠️ Yes
Notes: All configurations using BIGINT data types are potentially vulnerable. The vulnerability exists in the core database engine.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: HIGH - MariaDB instances exposed to untrusted networks are vulnerable to remote exploitation.
🏢 Internal Only: MEDIUM - Internal attackers or compromised systems could exploit this vulnerability.

🎯 Exploit Status

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

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

all

Restrict 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

all

Minimize 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

📤 Share & Export