← 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.5%9.0CVE-2012-3163Oracle mysql vulnerabilityUnspecified vulnerability in the MySQL Server component in Oracle MySQL 5.1.64 and earlier, and 5.5.26 and earlier, allows remote authenticated users…EPSS 5.1%9.0CVE-2003-0780MySQL get_salt_from_password buffer overflow allows code executionMySQL 4.0.14 and earlier, plus 3.23.x, contain a buffer overflow in get_salt_from_password in sql_acl.cc. An attacker with ALTER TABLE privileges can…EPSS 79%analysed9.0CVE-2003-0150MySQL world-writeable files allow privilege escalation to rootMySQL 3.23.55 and earlier creates world-writeable files and lets mysql users overwrite configuration files via the SELECT ... INTO OUTFILE operator. …EPSS 47%analysed8.5CVE-2005-2572Oracle mysql vulnerabilityMySQL, when running on Windows, allows remote authenticated users with insert privileges on the mysql.func table to cause a denial of service (server…EPSS 4.7%7.8CVE-2002-0969Oracle mysql classic buffer overflow vulnerabilityBuffer overflow in MySQL daemon (mysqld) before 3.23.50, and 4.0 beta before 4.02, on the Win32 platform, allows local users to execute arbitrary cod…EPSS 1.4%7.5CVE-2012-3158Oracle mysql vulnerabilityUnspecified vulnerability in the MySQL Server component in Oracle MySQL 5.1.64 and earlier, and 5.5.26 and earlier, allows remote attackers to affect…EPSS 4.5%

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