Oracle MySQL up to 5.6.5 Password Authentication sql/password.c memcmp improper authentication

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
5.1$0-$5k0.00

Summaryinfo

A vulnerability, which was classified as very critical, has been found in Oracle MySQL. This vulnerability affects the function memcmp of the file sql/password.c of the component Password Authentication. This manipulation causes improper authentication. This vulnerability appears as CVE-2012-2122. The attack may be initiated remotely. In addition, an exploit is available. Due to its background and reception, this vulnerability has an historic impact. It is recommended to apply a patch to fix this issue.

Detailsinfo

A vulnerability has been found in Oracle MySQL (Database Software) and classified as critical. Affected by this vulnerability is the function memcmp of the file sql/password.c of the component Password Authentication. The manipulation with an unknown input leads to a improper authentication vulnerability. The CWE definition for the vulnerability is CWE-287. When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. As an impact it is known to affect confidentiality, integrity, and availability. The summary by CVE is:

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.

The bug was discovered 06/09/2012. The weakness was presented 06/09/2012 by Sergei Golubchik with MariaDB as confirmed mailinglist post (oss-sec mailing list). It is possible to read the advisory at seclists.org. The vendor was not involved in the public release. This vulnerability is known as CVE-2012-2122 since 04/04/2012. The attack can be launched remotely. The exploitation doesn't need any form of authentication. Technical details and also a public exploit are known. The pricing for an exploit might be around USD $0-$5k at the moment (estimation calculated on 09/01/2024). Due to its background and reception, this vulnerability has a historic impact. The advisory points out:

This flaw was rooted in an assumption that the memcmp() function would always return a value within the range -127 to 127 (signed character). On some platforms and with certain optimizations enabled, this routine can return values outside of this range, eventually causing the code that compares a hashed password to sometimes return true even when the wrong password is specified. Since the authentication protocol generates a different hash each time this comparison is done, there is a 1 in 256 chance that ANY password would be accepted for authentication.

A public exploit has been developed by HD Moore (HDM) in Shell-Skript and been published 2 days after the advisory. It is possible to download the exploit at community.rapid7.com. It is declared as highly functional. We expect the 0-day to have been worth approximately $25k-$100k. The vulnerability scanner Nessus provides a plugin with the ID 74673 (openSUSE Security Update : mysql-cluster (openSUSE-SU-2012:0860-1)), which helps to determine the existence of the flaw in a target environment. It is assigned to the family SuSE Local Security Checks and running in the context l. The commercial vulnerability scanner Qualys is able to test this issue with plugin 165533 (SUSE Enterprise Linux Security Update for MySQL (SUSE-SU-2012:0984-1)). It is possible to verify the existence of the vulnerability with: @for i in `seq 1 1000`; do mysql -u root --password=bad -h 127.0.0.1 2>/dev/null; done@

Applying a patch is able to eliminate this problem. The bugfix is ready for download at bazaar.launchpad.net.Proper firewalling of tcp/3306 (mysql) is able to address this issue. The best possible mitigation is suggested to be patching the affected component. A possible mitigation has been published before and not just after the disclosure of the vulnerability.

The vulnerability is also documented in the databases at Exploit-DB (19092), Tenable (74673), SecurityFocus (BID 53911†), OSVDB (82804†) and Secunia (SA49417†). See VDB-5779 and VDB-61672 for similar entries. Be aware that VulDB is the high quality source for vulnerability data.

Productinfo

Type

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

Screenshot

Video

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 5.6
VulDB Meta Temp Score: 5.1

VulDB Base Score: 5.6
VulDB Temp Score: 5.1
VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

NVD Base Score: 🔍

Exploitinginfo

Class: Improper authentication
CWE: CWE-287
CAPEC: 🔍
ATT&CK: 🔍

Physical: No
Local: No
Remote: Yes

Availability: 🔍
Access: Public
Status: Highly functional
Author: HD Moore (HDM)
Programming Language: 🔍
Download: 🔍

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 74673
Nessus Name: openSUSE Security Update : mysql-cluster (openSUSE-SU-2012:0860-1)
Nessus File: 🔍
Nessus Risk: 🔍
Nessus Family: 🔍
Nessus Context: 🔍
Nessus Port: 🔍

OpenVAS ID: 71475
OpenVAS Name: Debian Security Advisory DSA 2496-1 (mysql-5.1)
OpenVAS File: 🔍
OpenVAS Family: 🔍

Qualys ID: 🔍
Qualys Name: 🔍

MetaSploit ID: mysql_authbypass_hashdump.rb
MetaSploit Name: MySQL Authentication Bypass Password Dump
MetaSploit File: 🔍

Exploit-DB: 🔍

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Patch
Status: 🔍

0-Day Time: 🔍
Exploit Delay Time: 🔍

Patch: bazaar.launchpad.net
Firewalling: 🔍
McAfee IPS: 🔍
McAfee IPS Version: 🔍

ISS Proventia IPS: 🔍
Fortigate IPS: 🔍

Timelineinfo

04/04/2012 🔍
05/07/2012 +33 days 🔍
06/09/2012 +33 days 🔍
06/09/2012 +0 days 🔍
06/11/2012 +1 days 🔍
06/11/2012 +0 days 🔍
06/11/2012 +0 days 🔍
06/11/2012 +0 days 🔍
06/12/2012 +0 days 🔍
06/13/2012 +1 days 🔍
06/26/2012 +13 days 🔍
06/13/2014 +717 days 🔍
09/01/2024 +3733 days 🔍

Sourcesinfo

Vendor: oracle.com

Advisory: seclists.org
Researcher: Sergei Golubchik
Organization: MariaDB
Status: Confirmed
Confirmation: 🔍

CVE: CVE-2012-2122 (🔍)
GCVE (CVE): GCVE-0-2012-2122
GCVE (VulDB): GCVE-100-5503

OVAL: 🔍

SecurityFocus: 53911 - Oracle MySQL CVE-2012-2122 User Login Security Bypass Vulnerability
Secunia: 49417
OSVDB: 82804 - CVE-2012-2122 - Oracle - Multiple Products - Security Bypass Issue
SecurityTracker: 1027143
Vulnerability Center: 35326 - Oracle MySQL Complied With Linux Glibc Sse-Optimized memcmp Option Allows Authentication Bypass, Medium

scip Labs: https://www.scip.ch/en/?labs.20161013
See also: 🔍

Entryinfo

Created: 06/11/2012 16:43
Updated: 09/01/2024 19:55
Changes: 06/11/2012 16:43 (108), 07/30/2019 20:21 (10), 09/01/2024 19:55 (16)
Complete: 🔍
Cache ID: 216::103

Be aware that VulDB is the high quality source for vulnerability data.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Do you know our Splunk app?

Download it now for free!