Bug 907438 - In MySQL, login cookie checking is not case-sensitive, reducing total entropy and allowing easier brute force
r=LpSolit,a=sgreen git-svn-id: svn://10.0.0.236/trunk@265057 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
e5338fb372
commit
71b4a797bc
@ -1 +1 @@
|
||||
8775
|
||||
8776
|
||||
@ -66,8 +66,8 @@ sub get_login_info {
|
||||
trick_taint($login_cookie);
|
||||
detaint_natural($user_id);
|
||||
|
||||
my $is_valid =
|
||||
$dbh->selectrow_array('SELECT 1
|
||||
my $db_cookie =
|
||||
$dbh->selectrow_array('SELECT cookie
|
||||
FROM logincookies
|
||||
WHERE cookie = ?
|
||||
AND userid = ?
|
||||
@ -77,7 +77,7 @@ sub get_login_info {
|
||||
# If the cookie or token is valid, return a valid username.
|
||||
# If they were not valid and we are using a webservice, then
|
||||
# throw an error notifying the client.
|
||||
if ($is_valid) {
|
||||
if (defined $db_cookie && $login_cookie eq $db_cookie) {
|
||||
# If we logged in successfully, then update the lastused
|
||||
# time on the login cookie
|
||||
$dbh->do("UPDATE logincookies SET lastused = NOW()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user