Skip to content

Commit

Permalink
Avoid DOS route with authentication of extremely long passwords.
Browse files Browse the repository at this point in the history
  • Loading branch information
MattBlissett committed Mar 12, 2024
1 parent b769059 commit 60c3147
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ public PagingResponse<GbifUser> search(
@Override
@Nullable
public GbifUser authenticate(String username, String password) {
if (Strings.isNullOrEmpty(username) || password == null) {
if (Strings.isNullOrEmpty(username) || Strings.isNullOrEmpty(password)) {
return null;
}

// Avoid DOS route with an attacker trying extremely long passwords.
if (!PASSWORD_LENGTH_RANGE.contains(password.length())) {
return null;
}

Expand Down

0 comments on commit 60c3147

Please sign in to comment.