Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-21581

CVE-2025-21581: Oracle MySQL Server DOS Vulnerability

CVE-2025-21581 is a denial of service vulnerability in Oracle MySQL Server affecting versions 8.0.0-8.0.41, 8.4.0-8.4.4, and 9.0.0-9.2.0. Attackers with high privileges can crash the server. This article covers technical details, impact, and mitigation.

Published:

CVE-2025-21581 Overview

CVE-2025-21581 is a denial of service vulnerability in the Oracle MySQL Server product, specifically within the Server: Optimizer component. The flaw affects supported versions 8.0.0-8.0.41, 8.4.0-8.4.4, and 9.0.0-9.2.0. A high-privileged attacker with network access via multiple protocols can trigger a hang or frequently repeatable crash, resulting in a complete denial of service of the MySQL Server. The weakness is classified under [CWE-732] (Incorrect Permission Assignment for Critical Resource). Oracle addressed this issue in the April 2025 Critical Patch Update.

Critical Impact

Successful exploitation causes a complete denial of service through a MySQL Server hang or repeatable crash, disrupting database availability for dependent applications.

Affected Products

  • Oracle MySQL Server versions 8.0.0 through 8.0.41
  • Oracle MySQL Server versions 8.4.0 through 8.4.4
  • Oracle MySQL Server versions 9.0.0 through 9.2.0

Discovery Timeline

  • 2025-04-15 - CVE-2025-21581 published to the National Vulnerability Database (NVD)
  • 2025-04-15 - Oracle released fix in the April 2025 Critical Patch Update
  • 2025-05-02 - NetApp published downstream advisory NTAP-20250502-0006
  • 2026-06-17 - Last updated in the NVD database

Technical Details for CVE-2025-21581

Vulnerability Analysis

The vulnerability resides in the MySQL Server query optimizer, the subsystem responsible for parsing SQL statements and generating execution plans. An authenticated attacker holding elevated database privileges can submit crafted queries that cause the optimizer to enter an unrecoverable state, hanging the server thread or producing a repeatable crash of the entire MySQL Server process.

Because the fault occurs at the server level rather than a session level, the disruption terminates all active connections and prevents new client sessions until the service is restarted. The impact is confined to availability. Confidentiality and integrity of stored data are not directly affected.

Root Cause

Oracle categorizes the underlying weakness under [CWE-732], covering incorrect permission assignment for a critical resource. In practice, the optimizer processes certain inputs from privileged users without adequately constraining resource consumption or validating internal state, allowing a crash or hang condition to propagate to the entire server.

Attack Vector

Exploitation requires network access to the MySQL Server and valid credentials with high privileges, such as accounts able to issue optimizer-influencing SQL. The attacker connects over any supported MySQL protocol and submits the crafted query. No user interaction is required. Because privileged database credentials are frequently held by application service accounts, credential compromise or supply-chain positioning can convert this into a practical availability attack.

No verified proof-of-concept code has been published. See the Oracle Security Alert April 2025 for vendor-supplied technical context.

Detection Methods for CVE-2025-21581

Indicators of Compromise

  • Unexpected MySQL Server process crashes or restarts recorded in mysqld.log or systemd journal entries referencing signal terminations.
  • Repeated long-running or hung sessions from a single privileged account followed by service unavailability.
  • Sudden spikes in Threads_running or CPU consumption traced to a small set of optimizer-heavy queries.

Detection Strategies

  • Enable the MySQL general query log or audit log on sensitive instances and review activity from SUPER, PROCESS, and administrative accounts for anomalous SQL patterns.
  • Correlate database crash events with authentication events to identify the originating client host and account.
  • Baseline query execution times per privileged account and alert on statistically significant deviations.

Monitoring Recommendations

  • Forward MySQL error logs and audit logs to a centralized SIEM for retention and correlation with network telemetry.
  • Monitor MySQL availability with external health checks and alert on abnormal restart frequency.
  • Track use of high-privilege accounts from non-application hosts, which is a common precursor to abuse.

How to Mitigate CVE-2025-21581

Immediate Actions Required

  • Apply the April 2025 Oracle Critical Patch Update to all affected MySQL Server instances.
  • Inventory MySQL deployments, including embedded and downstream distributions such as NetApp appliances referenced in NTAP-20250502-0006.
  • Rotate credentials for any high-privilege database account that is not strictly required for operations.

Patch Information

Oracle published fixes as part of the April 2025 Critical Patch Update. Administrators should upgrade to a patched release beyond 8.0.41, 8.4.4, or 9.2.0 as documented in the Oracle Security Alert April 2025. Users of downstream builds should consult vendor advisories such as NetApp NTAP-20250502-0006 for platform-specific packages.

Workarounds

  • Restrict network access to MySQL listeners so only trusted application hosts can reach the server.
  • Enforce least-privilege on database accounts and remove unnecessary administrative grants that satisfy the attack precondition.
  • Deploy connection rate limiting and query timeouts using MAX_EXECUTION_TIME hints or wait_timeout tuning to reduce hang duration until patching completes.
bash
# Example: verify installed MySQL Server version against fixed baseline
mysql -N -e "SELECT VERSION();"

# Example: restrict a high-privilege account to a specific application host
RENAME USER 'app_admin'@'%' TO 'app_admin'@'10.20.30.40';
FLUSH PRIVILEGES;

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.