As of now, we don't have any limits on failed login attempts recommended by OWASP A07:2021 – Identification and Authentication Failures. We should implement them to prevent brute force attacks.
TO-DO:
- Create a new database table for logging failed login attempts including:
- Username,
- Failed login timestamp.
- On a login attempt, make a query for failed login attempts within the last 60 seconds. If there were more than 5 failed attempts, automatically discard the request returning 429 (Too Many Requests) with a Retry-After header indicating a delay of 60 seconds.
As of now, we don't have any limits on failed login attempts recommended by OWASP A07:2021 – Identification and Authentication Failures. We should implement them to prevent brute force attacks.
TO-DO: