Skip to content
Vulnerability Intelligence

CVE-2012-2122

MediumPublic exploit

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 96% 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.

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

Exploited in the wild

No known

Not in a known-exploited catalog

Public exploit code

Available

Proof-of-concept or weaponized module

Get the full CVE-2012-2122 brief as a PDF

Every affected product and fixed release, exploitation status and a first 24 hours response checklist, emailed within minutes.

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 ('Type Confusion')

References

8 more references in the full CVE brief

FAQ

Common Questions.

Is CVE-2012-2122 Running On Your Attack Surface?

Brandefense maps vulnerabilities like this one to your internet-facing assets and tells you exactly where to patch.

Request A Demo