CVE-2024-21241

4.9 MEDIUM

📋 TL;DR

This vulnerability in MySQL Server's Optimizer component allows high-privileged attackers with network access to cause denial of service by crashing or hanging the server. It affects MySQL versions 8.0.39 and prior, 8.4.2 and prior, and 9.0.1 and prior. Attackers need administrative database privileges to exploit this vulnerability.

💻 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: Requires high privileged attacker (PR:H in CVSS) - typically MySQL root or administrative database users.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete denial of service where MySQL Server becomes unresponsive, requiring manual restart and causing extended downtime for dependent applications.

🟠

Likely Case

Targeted attacks by malicious insiders or compromised admin accounts causing service disruption and requiring database restarts.

🟢

If Mitigated

Limited impact due to proper privilege separation and network segmentation preventing unauthorized high-privileged access.

🌐 Internet-Facing: MEDIUM - While exploitable over network, attackers need high database privileges which are typically not exposed externally.
🏢 Internal Only: HIGH - Internal attackers with admin privileges or compromised admin accounts can easily exploit this to disrupt critical database services.

🎯 Exploit Status

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

CVSS indicates 'easily exploitable' but requires high privileges. No public exploit details available as of advisory publication.

🛠️ 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 patched version from Oracle MySQL downloads. 2. Backup databases and configuration. 3. Stop MySQL service. 4. Install updated version. 5. Restart MySQL service. 6. Verify version and functionality.

🔧 Temporary Workarounds

Restrict administrative access

all

Limit high-privileged database accounts to essential personnel and systems only

REVOKE ALL PRIVILEGES ON *.* FROM 'admin_user'@'%';
GRANT SELECT, INSERT, UPDATE, DELETE ON specific_db.* TO 'admin_user'@'specific_ip';

Network segmentation

linux

Restrict MySQL network access to only trusted application servers

iptables -A INPUT -p tcp --dport 3306 -s trusted_ip -j ACCEPT
iptables -A INPUT -p tcp --dport 3306 -j DROP

🧯 If You Can't Patch

  • Implement strict principle of least privilege for database accounts
  • Monitor for unusual administrative activity and failed connection attempts

🔍 How to Verify

Check if Vulnerable:

Run 'SELECT VERSION();' in MySQL and compare against affected versions: 8.0.39 and prior, 8.4.2 and prior, 9.0.1 and prior

Check Version:

mysql --version OR SELECT VERSION();

Verify Fix Applied:

After patching, run 'SELECT VERSION();' and confirm version is 8.0.40+, 8.4.3+, or 9.0.2+

📡 Detection & Monitoring

Log Indicators:

  • Unexpected MySQL crashes or restarts
  • Multiple failed connection attempts from admin accounts
  • Error logs showing optimizer-related crashes

Network Indicators:

  • Unusual traffic patterns to MySQL port 3306 from unexpected sources
  • Multiple rapid connections from admin accounts

SIEM Query:

source="mysql_error.log" AND ("crash" OR "hang" OR "optimizer") OR source="mysql_slow.log" AND user="root" AND count() > threshold

🔗 References

📤 Share & Export