CVE-2012-2122 Auth bypass in n/a

Medium 5.1 Published Updated

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.

All Mariadb Mariadb vulnerabilities

Sources

Also known as GHSA-4qx9-mwf7-7cx8.

Is CVE-2012-2122 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free