Security Problem with http authentication in rails
Posted by Blue Box Group on Mon Jun 08 08:07:00 UTC 2009
A potential security concern has been found with the digest authentication code in rails. The code for authenticate_with_http_digest should return true if a user is found, and false if it is not, however a bug was found where the function would return nil if an invalid username was used. The application would continue to process the validation in this case, which would allow an attacker to use an invalid username and blank password to gain access to a protected area of an app.
While this issue will be fixed in the 2.3.3 version of rails, a workaround for existing applications is to ensure that they never return nil. If your code looks like this:
authenticate_or_request_with_http_digest(REALM) do |username| USERS[username] end
…it should instead be changed to return false if the user is not found,
authenticate_or_request_with_http_digest(REALM) do |username| USERS[username] || false end
A full writeup from the rails development team can be found here: <a href=http://weblog.rubyonrails.org/2009/6/3/security-problem-with-authenticate_with_http_digest>http://weblog.rubyonrails.org/2009/6/3/security-problem-with-authenticate_with_http_digest
THE LATEST
THE ARCHIVES
- August 2010
- July 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007

