Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Security problem with authenticate_with_http_digest
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Koziarski  
View profile  
 More options Jun 3 2009, 7:09 pm
From: Michael Koziarski <mich...@koziarski.com>
Date: Thu, 4 Jun 2009 11:09:30 +1200
Local: Wed, Jun 3 2009 7:09 pm
Subject: Security problem with authenticate_with_http_digest
A security problem has been reported with the digest authentication
code in Ruby on Rails. This vulnerability can allow users to bypass
your password protection. This vulnerability has been publicly
disclosed on several websites, users are advised to take the
mitigating steps described below immediately.

The issue comes from the handling of the block passed to
authenticate_or_request_with_http_digest. This block must return the
user’s password in the clear, or a sha1 hash of the user’s password.
Unfortunately the documentation was unclear on this and the examples
cited would return nil if the user was not found. The correct
behaviour if the user doesn’t exist is to return false.

If the return value was nil, rails proceeded to verify this value
against the provided password. Because of this an attacker can provide
an invalid username and no password and authentication will succeed.

Fixed Versions
====

We have altered the behaviour of the relevant code to make nil an
authentication failure. This fix has been pushed to 2-3-stable and
will be present in 2.3.3 due to be released in the next few days. All
versions of edge rails after commit
1ad57cfe2fbda58439e4b7f84008ad23bc68e8b0 contain the fix.

Steps to Protect your application.
====

Users can protect themselves without upgrading by simply ensuring that
their authentication blocks never return nil. To take an example from
the documentation:

authenticate_or_request_with_http_digest(REALM) do |username|
  USERS[username]
end

Should instead be something like:

authenticate_or_request_with_http_digest(REALM) do |username|
  USERS[username] || false
end

Disclosure Notes
====

Due to communication difficulties and a mis-understanding between the
reporter and the security team. This vulnerability has been publicly
disclosed on several websites, users are advised to update their
applications immediately. Steps are being taken to ensure that the
security email is more reliable in the future. We regret the nature of
this disclosure and will endeavor to update processes and
documentation to ensure it doesn’t happen again in the future.

--
Cheers

Koz


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »