Skip to content
Emerging threatsMedium

CVE-2012-2122Mariadb Authentication Bypass

mysql: incorrect type cast in check_scramble() leading to authentication bypass

Published Jun 9, 2012 · Updated Mar 9, 2026

Key Facts

Patch immediately
  • CVE-2012-2122 is a medium-severity vulnerability (CVSS 5.1 v2) affecting Mariadb, Mysql (Oracle), mysql-5.1 (debian) and 9 more products.
  • It is not listed in any known-exploited vulnerabilities catalog. Public exploit code is available.
  • EPSS estimates a 97% probability of exploitation in the next 30 days.
  • Fixed versions are available, including Mysql 0:5.1.66-1.el6_3, mysql-5.1 5.1.63-0+squeeze1, mysql55 5.5.24-1.24.amzn1.
  • Brandefense priority: patch immediately, because it is very likely to be exploited soon.

Scores

CVSS v2

5.1

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

EPSS (30-day exploit likelihood)

97%

Higher than 99.8% of all scored CVEs

Exploit maturity

Proof of concept

ATLAS score

46/100

Publication score, see How it works

Exploitation Verdict

KEV listed

Not listed

Federal due date

None

No federal due date

Ransomware use

Not reported

Attributed actors

None named

Exploit & Defence Guidance

Exploit maturity

Proof of concept

Public exploit code

1

Proof-of-concept links

In-the-wild evidence

3

Reports of active use

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.

Affected Products

72 affected entries in total
ProductAffected versionsFixed in
MariadbMariadb5.1.41, 5.1.42, 5.1.44, 5.1.47, 5.1.49, 5.1.50, 5.1.51, 5.1.53n/a
MysqlOracle5.1.51, 5.1.52, 5.1.52-sp1, 5.1.53, 5.1.54, 5.1.55, 5.1.56, 5.1.570:5.1.66-1.el6_3
mysql-5.1debianSee advisory5.1.63-0+squeeze1
mysql55-benchamazonSee advisory5.5.24-1.24.amzn1
mysql55-commonamazonSee advisory5.5.24-1.24.amzn1
7 more affected products in the full CVE brief

Patched Releases

Mysql

0:5.1.66-1.el6_3

mysql-5.1

5.1.63-0+squeeze1

mysql55

5.5.24-1.24.amzn1

mysql55-bench

5.5.24-1.24.amzn1

mysql55-common

5.5.24-1.24.amzn1

mysql55-devel

5.5.24-1.24.amzn1

mysql55-embedded

5.5.24-1.24.amzn1

mysql55-embedded-devel

5.5.24-1.24.amzn1

mysql55-libs

5.5.24-1.24.amzn1

mysql55-server

5.5.24-1.24.amzn1

mysql55-test

5.5.24-1.24.amzn1

Timeline

  1. Publicly disclosed

    Jun 9, 2012

  2. Last updated

    Mar 9, 2026

Weakness Type

  • CWE-287 Improper Authentication
  • CWE-305 Authentication Bypass by Primary Weakness
  • CWE-393 Return of Wrong Status Code
  • CWE-704 Incorrect Type Conversion or Cast
  • CWE-843 Access of Resource Using Incompatible Type

FAQ

Common Questions.

Is CVE-2012-2122 On Your Attack Surface?

Brandefense matches it against the products discovered on your perimeter and opens a finding the day a CVE like this is listed.

Request A Demo

Figures as of Dec 4, 2026. Compiled by Brandefense technologies from public vulnerability catalogs; scoring as described in How it works.

To report an error, contact Brandefense.