CVE-2012-2122 - Improper Authentication

Severity

51%

Complexity

49%

Confidentiality

106%

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.

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.

CVSS 2.0 Base Score 5.1. CVSS Attack Vector: network. CVSS Attack Complexity: high. CVSS Vector: (AV:N/AC:H/Au:N/C:P/I:P/A:P).

Demo Examples

Improper Authentication

CWE-287

The following code intends to ensure that the user is already logged in. If not, the code performs authentication with the user-provided username and password. If successful, it sets the loggedin and user cookies to "remember" that the user has already logged in. Finally, the code performs administrator tasks if the logged-in user has the "Administrator" username, as recorded in the user cookie.


               
}
}
ExitError("Error: you need to log in first");
);
);
DoAdministratorTasks();

Unfortunately, this code can be bypassed. The attacker can set the cookies independently so that the code does not check the username and password. The attacker could do this with an HTTP request containing headers such as:


               
[body of request]

By setting the loggedin cookie to "true", the attacker bypasses the entire authentication check. By using the "Administrator" value in the user cookie, the attacker also gains privileges to administer the software.

Improper Authentication

CWE-287

Overview

First reported 12 years ago

2012-06-26 18:55:00

Last updated 11 years ago

2014-02-21 04:50:00

Affected Software

Oracle MySQL 5.1.51

5.1.51

Oracle MySQL 5.1.52

5.1.52

Oracle MySQL 5.1.52 Service Pack 1

5.1.52

Oracle MySQL 5.1.53

5.1.53

Oracle MySQL 5.1.54

5.1.54

Oracle MySQL 5.1.55

5.1.55

Oracle MySQL 5.1.56

5.1.56

Oracle MySQL 5.1.57

5.1.57

Oracle MySQL 5.1.58

5.1.58

Oracle MySQL 5.1.59

5.1.59

Oracle MySQL 5.1.60

5.1.60

Oracle MySQL 5.1.61

5.1.61

Oracle MySQL 5.5.10

5.5.10

Oracle MySQL 5.5.11

5.5.11

Oracle MySQL 5.5.12

5.5.12

Oracle MySQL 5.5.13

5.5.13

Oracle MySQL 5.5.14

5.5.14

Oracle MySQL 5.5.15

5.5.15

Oracle MySQL 5.5.16

5.5.16

Oracle MySQL 5.5.17

5.5.17

Oracle MySQL 5.5.18

5.5.18

Oracle MySQL 5.5.19

5.5.19

Oracle MySQL 5.5.20

5.5.20

Oracle MySQL 5.5.21

5.5.21

Oracle MySQL 5.6.2

5.6.2

Oracle MySQL 5.6.3

5.6.3

Oracle MySQL 5.6.4

5.6.4

Oracle MySQL 5.6.5

5.6.5

MariaDB 5.1.41

5.1.41

MariaDB 5.1.42

5.1.42

MariaDB 5.1.44

5.1.44

MariaDB 5.1.47

5.1.47

MariaDB 5.1.49

5.1.49

MariaDB 5.1.50

5.1.50

MariaDB 5.1.51

5.1.51

MariaDB 5.1.53

5.1.53

MariaDB 5.1.55

5.1.55

MariaDB 5.1.60

5.1.60

MariaDB 5.1.61

5.1.61

MariaDB 5.2.0

5.2.0

MariaDB 5.2.1

5.2.1

MariaDB 5.2.2

5.2.2

MariaDB 5.2.3

5.2.3

MariaDB 5.2.4

5.2.4

MariaDB 5.2.5

5.2.5

MariaDB 5.2.6

5.2.6

MariaDB 5.2.7

5.2.7

MariaDB 5.2.8

5.2.8

MariaDB 5.2.9

5.2.9

MariaDB 5.2.10

5.2.10

MariaDB 5.2.11

5.2.11

MariaDB 5.3.0

5.3.0

MariaDB 5.3.1

5.3.1

MariaDB 5.3.2

5.3.2

MariaDB 5.3.3

5.3.3

MariaDB 5.3.4

5.3.4

MariaDB 5.3.5

5.3.5

MariaDB 5.3.6

5.3.6

MariaDB 5.5.20

5.5.20

MariaDB 5.5.21

5.5.21

MariaDB 5.5.22

5.5.22

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.