← Vulnerability feed

Vulnerability record · CVE-2012-2122 · published 26 June 2012

CVE-2012-2122: MySQL and MariaDB authentication bypass via repeated wrong password

Oracle · Mysql

Oracle MySQL and MariaDB compare password tokens with memcmp in certain environments, and the return value is not checked properly. Repeatedly authenticating with the same incorrect password can eventually make the token comparison succeed, bypassing authentication entirely.

5.1 CVSS 2.0 Medium EPSS 97% · top 0.1% CWE-287 · Improper authentication
5.1CVSS 2.0 base score
97%EPSS exploitation probability, 30 days
NoNot in CISA KEV
2Affected product versions listed by NVD
22References, 6 tagged exploit
16 Jun 2026Last modified by NVD

Description

sql/password.c in Oracle MySQL 5.1.x before 5.1.63, 5.5.x before 5.5.24, and 5.6.x before 5.6.6, and MariaDB 5.1.x before 5.1.62, 5.2.x before 5.2.12, 5.3.x before 5.3.6, and 5.5.x before 5.5.23, when running in certain environments with certain implementations of the memcmp function, allows remote attackers to bypass authentication by repeatedly authenticating with the same incorrect password, which eventually causes a token comparison to succeed due to an improperly-checked return value.

AV:N/AC:H/Au:N/C:P/I:P/A:P

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 18 September 2026. Confidence: high.

high priorityPublic exploit code exists and EPSS is very high, but the CVSS 2.0 base score is only 5.1 and exploitation requires a specific memcmp environment.

What it is

Oracle MySQL and MariaDB compare password tokens with memcmp in certain environments, and the return value is not checked properly. Repeatedly authenticating with the same incorrect password can eventually make the token comparison succeed, bypassing authentication entirely.

Impact

An attacker gains authenticated access to the database server without valid credentials, potentially reading or modifying data and executing SQL with the privileges of the targeted account.

Attack surface

Reachable remotely over the MySQL protocol (AV:N) with no authentication required (Au:N) and no user interaction. Exploitation depends on the target running in an environment with a memcmp implementation that triggers the flawed comparison (AC:H).

Exploitation

CISA KEV does not list it, but EPSS is 0.965 (99.879th percentile) and multiple references are tagged Exploit, including Exploit-DB and Metasploit coverage, indicating public exploit code exists.

What to do

  • Upgrade MySQL to 5.1.63, 5.5.24, or 5.6.6 and later, or MariaDB to 5.1.62, 5.2.12, 5.3.6, or 5.5.23 and later.
  • If immediate patching is not possible, restrict network access to the database port to trusted hosts only.
  • Disable or tightly control remote root and other privileged account logins from untrusted networks.
  • Monitor for and block repeated failed authentication attempts from the same source.
  • Apply vendor advisories for OpenSUSE and Gentoo where the affected packages are used.

Detection

  • Alert on bursts of failed authentication attempts from a single source followed by a successful login.
  • Review MySQL/MariaDB authentication logs for repeated identical incorrect-password attempts.
  • Hunt for known exploit tooling or Metasploit module traffic against the database port.
  • Baseline and monitor successful logins from unexpected hosts or accounts.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

2 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

Track CVE-2012-2122 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2012-2750Oracle mysql vulnerabilityUnspecified vulnerability in MySQL 5.5.x before 5.5.23 has unknown impact and attack vectors related to a "Security Fix", aka Bug #59533. NOTE: this …EPSS 3.6%10.0CVE-2004-0836Oracle mysql memory buffer overflow vulnerabilityBuffer overflow in the mysql_real_connect function in MySQL 4.x before 4.0.21, and 3.x before 3.23.49, allows remote DNS servers to cause a denial of…EPSS 9.8%9.9CVE-2026-32710Mariadb heap-based buffer overflow vulnerabilityMariaDB server is a community developed fork of MySQL server. An authenticated user can crash MariaDB versions 11.4 before 11.4.10 and 11.8 before 11…EPSS 0.80%9.8CVE-2026-49261Mariadb os command injection vulnerabilityMariaDB server is a community developed fork of MySQL server. Versions 10.6.1 through 10.6.26, 10.11.1 through 10.11.17, 11.4.1 through 11.4.11, 11.8…EPSS 1.7%9.8CVE-2023-26785Mariadb code injection vulnerabilityMariaDB v10.5 was discovered to contain a remote code execution (RCE) vulnerability via UDF Code in a Shared Object File, followed by a "create funct…EPSS 2.2%9.8CVE-2020-11656Sqlite use after free vulnerabilityIn SQLite through 3.31.1, the ALTER TABLE implementation has a use-after-free, as demonstrated by an ORDER BY clause that belongs to a compound SELEC…EPSS 7.6%9.8CVE-2019-14540Fasterxml jackson-databind deserialization of untrusted data vulnerabilityA Polymorphic Typing issue was discovered in FasterXML jackson-databind before 2.9.10. It is related to com.zaxxer.hikari.HikariConfig.EPSS 11%9.8CVE-2016-9843Zlib vulnerabilityThe crc32_big function in crc32.c in zlib 1.2.8 might allow context-dependent attackers to have unspecified impact via vectors involving big-endian C…EPSS 5.8%

Source: NIST National Vulnerability Database (record CVE-2012-2122), CISA KEV, FIRST EPSS (scores of 2026-09-25). This page is refreshed as NVD updates the record.