CVE-2012-2122 Auth bypass in n/a
Remote attackers can bypass authentication in MySQL and MariaDB by exploiting a memcmp implementation flaw, allowing unauthorized access without valid credentials.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2012-2122?
CVE-2012-2122 is a medium-severity authentication bypass vulnerability in Mariadb Mariadb, published on 26 Jun 2012. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Weakness: CWE-287
Which versions are affected by CVE-2012-2122?
It affects 2 products.
Products include Mariadb Mariadb, Oracle Mysql.
How do I fix CVE-2012-2122?
Upgrade to a fixed version.
Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.
Is CVE-2012-2122 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2012-2122 exists.
Public exploit code: 1 Metasploit module, 1 Exploit-DB entry, 1 Nuclei template and 5 proofs of concept on GitHub.
Other vulnerabilities in Mariadb Mariadb
- CVE-2026-49261 MariaDB server has unsafe parameter handling in `wsrep_notify_cmd`
- CVE-2026-85746 MariaDB: Out-of-bound buffer write on in `ST_AsText` of nested GeometryCollections
- CVE-2026-85748 MariaDB: Use-after-free with a large number of SYS_REFCURSOR's
- CVE-2026-92262 MariaDB: Numerous issues caused by historical #mysql50# tablename encoding bypass.
- CVE-2023-26785 Code injection in n/a
Sources
Also known as GHSA-4qx9-mwf7-7cx8.