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
Advisories And Exploit References
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| Product | Affected versions | Fixed in |
|---|---|---|
| MariadbMariadb | 5.1.41, 5.1.42, 5.1.44, 5.1.47, 5.1.49, 5.1.50, 5.1.51, 5.1.53 | n/a |
| MysqlOracle | 5.1.51, 5.1.52, 5.1.52-sp1, 5.1.53, 5.1.54, 5.1.55, 5.1.56, 5.1.57 | 0:5.1.66-1.el6_3 |
| mysql-5.1debian | See advisory | 5.1.63-0+squeeze1 |
| mysql55-benchamazon | See advisory | 5.5.24-1.24.amzn1 |
| mysql55-commonamazon | See advisory | 5.5.24-1.24.amzn1 |
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
Publicly disclosed
Jun 9, 2012
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
References
- advisoryRHSA-2012:1462
- advisory49417
- patch[oss-security] 20120609 Security vulnerability in MySQL/MariaDB sql/password.c
- exploitcommunity.rapid7.com · CVE-2012-2122
- exploitbugs.mysql.com · bug.php
FAQ
Common Questions.
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…
Affected: Mariadb versions 5.1.41, 5.1.42, 5.1.44, 5.1.47, 5.1.49, 5.1.50, 5.1.51, 5.1.53; Mysql (Oracle) versions 5.1.51, 5.1.52, 5.1.52-sp1, 5.1.53, 5.1.54, 5.1.55, 5.1.56, 5.1.57; mysql-5.1 (debian), among others. The full list is in the CVE brief.
It is not listed in any known-exploited vulnerabilities catalog.
No, it is not currently listed in the CISA Known Exploited Vulnerabilities catalog.
Public exploit code is available.
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.
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