CVE-2012-3424 - Improper Authentication

Severity

50%

Complexity

99%

Confidentiality

48%

The decode_credentials method in actionpack/lib/action_controller/metal/http_authentication.rb in Ruby on Rails 3.x before 3.0.16, 3.1.x before 3.1.7, and 3.2.x before 3.2.7 converts Digest Authentication strings to symbols, which allows remote attackers to cause a denial of service by leveraging access to an application that uses a with_http_digest helper method, as demonstrated by the authenticate_or_request_with_http_digest method.

The decode_credentials method in actionpack/lib/action_controller/metal/http_authentication.rb in Ruby on Rails 3.x before 3.0.16, 3.1.x before 3.1.7, and 3.2.x before 3.2.7 converts Digest Authentication strings to symbols, which allows remote attackers to cause a denial of service by leveraging access to an application that uses a with_http_digest helper method, as demonstrated by the authenticate_or_request_with_http_digest method.

CVSS 2.0 Base Score 5. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (AV:N/AC:L/Au:N/C:N/I:N/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

Type

Ruby on Rails

First reported 12 years ago

2012-08-08 10:26:00

Last updated 5 years ago

2019-08-08 15:42:00

Affected Software

Ruby on Rails Rails 3.0.0 Beta

3.0.0

Ruby on Rails Rails 3.0.0 Beta 2

3.0.0

Ruby on Rails Rails 3.0.0 Beta 3

3.0.0

Ruby on Rails Rails 3.0.0 Beta 4

3.0.0

Ruby on Rails Rails 3.0.0 Release Candidate

3.0.0

Ruby on Rails Rails 3.0.0 Release Candidate 2

3.0.0

Ruby on Rails Rails 3.0.1

3.0.1

Ruby on Rails Rails 3.0.1 Pre

3.0.1

Ruby on Rails Rails 3.0.2

3.0.2

Ruby on Rails Rails 3.0.2 Pre

3.0.2

Ruby on Rails Rails 3.0.3

3.0.3

Ruby on Rails Rails 3.0.4 Release Candidate 1

3.0.4

Ruby on Rails Rails 3.0.5 Release Candidate 1

3.0.5

Ruby on Rails Rails 3.0.6 Release Candidate 1

3.0.6

Ruby on Rails Rails 3.0.6 Release Candidate 2

3.0.6

Ruby on Rails Rails 3.0.7 Release Candidate 1

3.0.7

Ruby on Rails Rails 3.0.7 Release Candidate 2

3.0.7

Ruby on Rails Rails 3.0.8 Release Candidate 1

3.0.8

Ruby on Rails Rails 3.0.8 Release Candidate 2

3.0.8

Ruby on Rails Rails 3.0.8 Release Candidate 3

3.0.8

Ruby on Rails Rails 3.0.8 Release Candidate 4

3.0.8

Ruby on Rails Rails 3.0.9 Release Candidate 1

3.0.9

Ruby on Rails Rails 3.0.9 Release Candidate 2

3.0.9

Ruby on Rails Rails 3.0.9 Release Candidate 3

3.0.9

Ruby on Rails Rails 3.0.9 Release Candidate 4

3.0.9

Ruby on Rails Rails 3.0.9 Release Candidate 5

3.0.9

Ruby on Rails Rails 3.0.10 Release Candidate 1

3.0.10

Ruby on Rails Rails 3.0.11

3.0.11

Ruby on Rails Rails 3.0.12 Release Candidate 1

3.0.12

Ruby on Rails Rails 3.0.13 Release Candidate 1

3.0.13

Ruby on Rails Rails 3.0.14

3.0.14

Ruby on Rails 3.0.4

3.0.4

Ruby on Rails Rails 3.1.0 Beta1

3.1.0

Ruby on Rails Rails 3.1.0 Release Candidate 1

3.1.0

Ruby on Rails Rails 3.1.0 Release Candidate 2

3.1.0

Ruby on Rails Rails 3.1.0 Release Candidate 3

3.1.0

Ruby on Rails Rails 3.1.0 Release Candidate 4

3.1.0

Ruby on Rails Rails 3.1.0 Release Candidate 5

3.1.0

Ruby on Rails Rails 3.1.0 Release Candidate 6

3.1.0

Ruby on Rails Rails 3.1.0 Release Candidate 7

3.1.0

Ruby on Rails Rails 3.1.0 Release Candidate 8

3.1.0

Ruby on Rails Rails 3.1.1 Release Candidate 1

3.1.1

Ruby on Rails Rails 3.1.1 Release Candidate 2

3.1.1

Ruby on Rails Rails 3.1.1 Release Candidate 3

3.1.1

Ruby on Rails Rails 3.1.2 Release Candidate 1

3.1.2

Ruby on Rails Rails 3.1.2 Release Candidate 2

3.1.2

Ruby on Rails Rails 3.1.3

3.1.3

Ruby on Rails Rails 3.1.4 Release Candidate 1

3.1.4

Ruby on Rails Rails 3.1.5 Release Candidate 1

3.1.5

Ruby on Rails Rails 3.1.6

3.1.6

Ruby on Rails Rails 3.2.0 Release Candidate 1

3.2.0

Ruby on Rails Rails 3.2.0 Release Candidate 2

3.2.0

Ruby on Rails Rails 3.2.1

3.2.1

Ruby on Rails Rails 3.2.2 Release Candidate 1

3.2.2

Ruby on Rails Rails 3.2.3 Release Candidate 1

3.2.3

Ruby on Rails Rails 3.2.3 Release Candidate 2

3.2.3

Ruby on Rails Rails 3.2.4 Release Candidate 1

3.2.4

Ruby on Rails Rails 3.2.5

3.2.5

Ruby on Rails Rails 3.2.6

3.2.6

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.