CVE-2024-21230

6.5 MEDIUM

📋 TL;DR

This vulnerability in MySQL Server's optimizer component allows authenticated attackers with low privileges to cause denial of service by crashing or hanging the database server. It affects MySQL 8.0.39 and earlier, 8.4.2 and earlier, and 9.0.1 and earlier versions. Attackers need network access but only basic database user credentials.

💻 Affected Systems

Products:
  • Oracle MySQL Server
Versions: 8.0.39 and prior, 8.4.2 and prior, 9.0.1 and prior
Operating Systems: All operating systems running affected MySQL versions
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all MySQL deployments with optimizer component enabled (default). Requires attacker to have CREATE, INSERT, or similar low-level privileges.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database server outage causing application downtime and service disruption until manual restart.

🟠

Likely Case

Intermittent database crashes affecting application availability and requiring administrator intervention.

🟢

If Mitigated

Limited impact due to network segmentation and strict access controls preventing unauthorized connections.

🌐 Internet-Facing: HIGH - Network accessible vulnerability that only requires low-privilege credentials.
🏢 Internal Only: MEDIUM - Requires authenticated access but could be exploited by malicious insiders or compromised accounts.

🎯 Exploit Status

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

Oracle describes as 'easily exploitable' but requires authenticated access. No public exploit code identified at time of analysis.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: MySQL 8.0.40, 8.4.3, 9.0.2 or later

Vendor Advisory: https://www.oracle.com/security-alerts/cpuoct2024.html

Restart Required: Yes

Instructions:

1. Download latest MySQL version from Oracle website. 2. Backup databases. 3. Stop MySQL service. 4. Install updated version. 5. Restart MySQL service. 6. Verify version and functionality.

🔧 Temporary Workarounds

Network Access Restriction

linux

Limit MySQL network access to only trusted application servers using firewall rules.

# Linux iptables example: iptables -A INPUT -p tcp --dport 3306 -s trusted_ip -j ACCEPT
# Then: iptables -A INPUT -p tcp --dport 3306 -j DROP

Privilege Reduction

all

Review and minimize database user privileges, removing unnecessary CREATE/INSERT permissions.

REVOKE CREATE, INSERT ON *.* FROM 'username'@'host';
FLUSH PRIVILEGES;

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate MySQL servers from untrusted networks
  • Enforce principle of least privilege for all database user accounts and monitor for suspicious activity

🔍 How to Verify

Check if Vulnerable:

Connect to MySQL and run: SELECT VERSION(); Compare against affected version ranges.

Check Version:

mysql --version OR SELECT VERSION();

Verify Fix Applied:

After patching, run SELECT VERSION(); to confirm version is 8.0.40+, 8.4.3+, or 9.0.2+. Test optimizer functionality with complex queries.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected MySQL crashes or restarts in error logs
  • Multiple failed connection attempts from single sources
  • Unusual optimizer-related errors

Network Indicators:

  • Multiple TCP connections to port 3306 followed by connection resets
  • Unusual query patterns from low-privilege accounts

SIEM Query:

source="mysql_error.log" AND ("crash" OR "segmentation fault" OR "optimizer")

🔗 References

📤 Share & Export