Skip to content

Commit

Permalink
Use the same error message for different kind of authentiction errors (
Browse files Browse the repository at this point in the history
…librenms#13306)

This prevents usernames to be guess as the application confirms or denies their existence.
  • Loading branch information
Jellyfrog authored Oct 1, 2021
1 parent 65b385f commit 0680dc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LibreNMS/Authentication/MysqlAuthorizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function authenticate($credentials)
$enabled = $user_data->enabled;

if (! $enabled) {
throw new AuthenticationException($message = 'login denied');
throw new AuthenticationException();
}

if (Hash::check($password, $hash)) {
Expand Down
2 changes: 1 addition & 1 deletion app/Providers/LegacyUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function validateCredentials(Authenticatable $user, array $credentials)
}

if (empty($credentials['username']) || ! $authorizer->authenticate($credentials)) {
throw new AuthenticationException('Invalid Credentials');
throw new AuthenticationException();
}

return true;
Expand Down

0 comments on commit 0680dc8

Please sign in to comment.