Mysql ServerDatabase / datastore · Oracle

CVE-2023-21872

MEDIUM · 5.5 CVSS v3.1 Published 2023-01-18
Fix available
A fix is available. Upgrade to after 8.0.29 or later.
See remediation →
61/100
Remediation priority · Elevated
Remotely reachable Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Vulnerability in the MySQL Server product of Oracle MySQL (component: Server: Optimizer). Supported versions that are affected are 8.0.29 and prior. Easily exploitable vulnerability allows high privileged attacker with network access via multiple protocols to compromise MySQL Server. Successful attacks of this vulnerability can result in unauthorized ability to cause a hang or frequently repeatable crash (complete DOS) of MySQL Server as well as unauthorized update, insert or delete access to some of MySQL Server accessible data. CVSS 3.1 Base Score 5.5 (Integrity and Availability impacts). CVSS Vector: (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:L/A:H).

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

A vulnerability in the MySQL Server Optimizer component allows a high-privileged attacker with network access to cause a denial of service (hang or crash) and gain unauthorized insert, update, or delete access to certain accessible data. The attack is easily exploitable but requires high-level database privileges.

MitigationUpgrade MySQL Server to version 8.0.30 or later. If immediate patching is not possible, restrict network access to the database and limit privileged account usage to reduce attack surface.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Mysql ServerDatabase / datastore
Affected:>= 8.0.0, <= 8.0.29

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
High
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
High

CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:L/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify MySQL Server version
    Run 'SELECT VERSION();' or check the MySQL server binary/version using 'mysqld --version' or checking the installed package information (e.g., 'rpm -q mysql-server' or 'dpkg -l mysql-server').
    Affected if The installed version is greater than or equal to 8.0.0 and less than or equal to 8.0.29.
  2. Confirm network accessibility
    Check if MySQL is listening on a network interface (typically port 3306) by reviewing MySQL configuration files (my.cnf or my.ini) for 'bind-address' settings, or by running 'netstat -tlnp | grep 3306' or 'ss -tlnp | grep 3306'.
    Affected if MySQL is bound to a non-localhost address (0.0.0.0 or specific IP) and is reachable over the network.
  3. Identify high-privileged accounts
    Query for users with elevated privileges using 'SELECT user, host, plugin FROM mysql.user WHERE priv_level IN ('Select_priv','Insert_priv','Update_priv','Delete_priv') AND user NOT IN ('root','mysql.infoschema','mysql.session','mysql.sys');' Review accounts with DBA, ADMIN, or broad INSERT/UPDATE/DELETE privileges.
    Affected if There are multiple high-privileged accounts beyond the root and system accounts, as an attacker would need one of these to exploit the vulnerability.
  4. Check optimizer-related activity
    Review slow query logs or general query logs for complex queries involving JOIN operations, subqueries, or optimizer hints, as the vulnerability exists in the Optimizer component. Enable slow query logging if not already active: 'SET GLOBAL slow_query_log = 1; SET GLOBAL long_query_time = 0;'.
    Affected if Complex optimizer-dependent queries are being executed, indicating active use of the affected component.

You are affected if your MySQL Server version is between 8.0.0 and 8.0.29 inclusive AND the server is network-accessible AND there exists a high-privileged account that could be compromised.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to a release after 8.0.29
Interim mitigation

Upgrade MySQL Server to version 8.0.30 or later. If immediate patching is not possible, restrict network access to the database and limit privileged account usage to reduce attack surface.

Recommended fix High confidence

MySQL Server 8.0.30 or later

  1. 1. Back up all MySQL databases before performing any upgrade
  2. 2. Review MySQL 8.0.30 release notes for any breaking changes relevant to your configuration
  3. 3. Stop the MySQL Server service
  4. 4. Upgrade MySQL Server to version 8.0.30 or later
  5. 5. Run mysql_upgrade to check and update system tables if needed
  6. 6. Restart the MySQL Server service
  7. 7. Verify the server is running and test application functionality
Caveat Review MySQL 8.0.30 release notes for optimizer changes and any compatibility notes before upgrading

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Mysql Server Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing8.0 h
  • Review / QA4.0 h
24.0 hours of engineering $4,160
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $6,656.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2023-21872 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2023-21872 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data