Skip Menu |

This queue is for tickets about the Apache2-AuthCookieDBI CPAN distribution.

Report information
The Basics
Id: 62470
Status: resolved
Priority: 0/
Queue: Apache2-AuthCookieDBI

People
Owner: matisse [...] spamcop.net
Requestors: lawsonk [...] libertas-tech.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.05
Fixed in: 2.13



Subject: User authenticated if not in MySQL database
Hello, I just installed Apache2::AuthCookieDBI to wrap MySQL authentication around some applications on my server. It may be a configuration problem on my part but I discovered the following authentication problem with my setup. I have authrealmDBI_CryptType set to "crypt". This works fine when I pass a valid username to the login script but when I pass a username that doesn't exist in the MySQL database I get authenticated when I shouldn't. When the user name isn't in the database the following lines get executed: 545 $r->log_error( 546 "Apache2::AuthCookieDBI: couldn't select password from $c->{ DBI_DSN }, $c->{ DBI_UsersTable }, $c->{ DBI_UserField } for user $user for au th realm $auth_name", 547 $r->uri 548 ); 549 return; 550 } 551 } _get_crypted_password returns undef. When undef is passed to "_check_password" $crypted_password isn't populates so the following statement returns true and authenticates the user: 468 'crypt' => sub { 469 my $salt = substr $crypted_password, 0, 2; 470 return crypt( $password, $salt ) eq $crypted_password; 471 }, I just added "return unless $crypted_password" to the start of "_check_password" to fix the issue on my server. Thanks, Keith.
Ow. That's pretty bad. I will add a test and fix in next release, which I hope will happen by end of November (I have been overwhelmed with $work for several months now.)
I have a new version of the module with a number of changes - I wonder if you would be interested in testing it?
From: lawsonk [...] libertas-tech.com
Sure I'd be happy to give it a shot. I'll see about merging in the other changes I've made as well.
I've uploaded 2.13 to CPAN and would be grateful if you would try it out. I'm considering moving the source code to github by the way.
Marking resolved. But note that 2.13 has some bugs, which are addressed in 2.14, coming soon.