CVE-2024-21177

6.5 MEDIUM

📋 TL;DR

This vulnerability in MySQL Server's Optimizer component allows authenticated attackers with network access to cause a denial of service by crashing or hanging the server. It affects MySQL 8.0.37 and earlier, and 8.4.0 and earlier versions. Attackers need only low-privileged database access to exploit this vulnerability.

💻 Affected Systems

Products:
  • Oracle MySQL Server
Versions: 8.0.37 and prior, 8.4.0 and prior
Operating Systems: All platforms running affected MySQL versions
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the Optimizer component; requires network access and low-privileged database account

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete MySQL Server outage causing application downtime and service disruption until server restart

🟠

Likely Case

Intermittent server crashes or hangs requiring manual intervention to restore service

🟢

If Mitigated

Limited impact with proper network segmentation and minimal privileged accounts

🌐 Internet-Facing: HIGH - Network accessible vulnerability that can be exploited remotely
🏢 Internal Only: MEDIUM - Requires authenticated access but low privileges are sufficient

🎯 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 known

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: MySQL 8.0.38 and 8.4.1 or later

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

Restart Required: Yes

Instructions:

1. Download latest MySQL version from Oracle website 2. Backup databases 3. Stop MySQL service 4. Apply patch/upgrade 5. Restart MySQL service 6. Verify functionality

🔧 Temporary Workarounds

Network Access Restriction

all

Restrict network access to MySQL to only trusted hosts/IPs

# In MySQL my.cnf: bind-address = 127.0.0.1
# Or use firewall: iptables -A INPUT -p tcp --dport 3306 -s trusted_ip -j ACCEPT

Privilege Minimization

all

Review and reduce database user privileges to minimum required

REVOKE ALL PRIVILEGES ON *.* FROM 'user'@'%';
GRANT SELECT, INSERT, UPDATE, DELETE ON database.* TO 'user'@'%';

🧯 If You Can't Patch

  • Implement strict network segmentation and firewall rules to limit MySQL access
  • Apply principle of least privilege to all database accounts and monitor for suspicious activity

🔍 How to Verify

Check if Vulnerable:

Check MySQL version: SELECT VERSION(); - if version is 8.0.37 or earlier, or 8.4.0 or earlier, system is vulnerable

Check Version:

mysql -u root -p -e 'SELECT VERSION();'

Verify Fix Applied:

After patching: SELECT VERSION(); should show 8.0.38+ or 8.4.1+

📡 Detection & Monitoring

Log Indicators:

  • MySQL crash logs
  • Unexpected server restarts in error logs
  • Connection spikes from single source

Network Indicators:

  • Multiple failed queries from same source
  • Unusual optimizer-related query patterns

SIEM Query:

source="mysql.log" ("crash" OR "segmentation fault" OR "aborted")

🔗 References

📤 Share & Export