Skip to content

Commit e37d2b4

Browse files
committed
add random delay on login dokuwiki#4491
This is meant to mitigate timing attacks on the login mechanism.
1 parent 9b006b5 commit e37d2b4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

inc/auth.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ function auth_login($user, $pass, $sticky = false, $silent = false)
305305

306306
if (!empty($user)) {
307307
//usual login
308+
if (!empty($pass)) usleep(rand(0, 250)); // add a random delay to prevent timing attacks #4491
308309
if (!empty($pass) && $auth->checkPass($user, $pass)) {
309310
// make logininfo globally available
310311
$INPUT->server->set('REMOTE_USER', $user);

0 commit comments

Comments
 (0)