← Java / Spring · Contents

JAVA-050 / Intermediate

No login-attempt limit (brute force)

A07:2021 Identification and Authentication Failures · CWE-307 Excessive Authentication Attempts

Why is this a problem?

Automated guessing attacks.

How to fix it

java
// Track failures by account and IP, delay or lock after the threshold, and apply rate limiting such as Bucket4j
if (limiter.isBlocked(key)) throw new TooManyRequests();

Further reading