CVE-2012-2122: 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 b…
CVE-2012-2122 affects 25 listed versions of MariaDB, Oracle MySQL in the Dawnsentry catalogue.
Affected products and versions
The versions in the Dawnsentry catalogue this CVE affects, judged from the vendor's own advisory where there is one, otherwise from the CVE record and NVD, as each version's own page says.
MariaDB
22 of 250 listed versions are affected. Fixed in 5.2.12, 5.1.62. The newest release, 13.1.2, is not affected.
5.3.6 5.3.5 5.3.4 5.3.3 5.3.2 5.3.1 5.3.0 5.2.11 5.2.10 5.2.9 5.2.8 5.2.7 5.2.6 5.2.5 5.2.4 5.2.3 5.2.2 5.2.1 5.2.0 5.1.61 5.1.60 5.1.55
Oracle MySQL
3 of 221 listed versions are affected. Fixed in 5.1.62. The newest release, 26.10.0, is not affected.
What it is
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 (NVD)
Published by Red Hat on 26 June 2012. Last changed 16 June 2026. Exploit code is public (Metasploit or Nuclei).
Sources
Check one version you run: look CVE-2012-2122 up, or pick a product and version in the quick lookup.
Updated 1 December 2026.