Skip to content

Commit

Permalink
Added usleep :(
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <snipe@snipe.net>
  • Loading branch information
snipe committed Feb 16, 2022
1 parent 321be47 commit 178e440
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/Auth/ForgotPasswordController.php
Expand Up @@ -87,6 +87,8 @@ public function sendResetLinkEmail(Request $request)
\Log::info('Password reset attempt: User '.$request->input('username').'failed with exception: '.$e );
}

// Prevent timing attack to enumerate users.
usleep(500000 + random_int(0, 1500000));

if ($response === \Password::RESET_LINK_SENT) {
\Log::info('Password reset attempt: User '.$request->input('username').' WAS found, password reset sent');
Expand Down

0 comments on commit 178e440

Please sign in to comment.