← Java / Spring · Contents

JAVA-093 / Advanced

Long-password bcrypt 72-byte truncation and DoS (Argon2/PBKDF2 parameters)

A02:2021 · CWE-916 Insufficient Computational Effort · CWE-400

Why is this a problem?

Low iteration counts make guessing easy, while excessive counts cause DoS.

How to fix it

java
Argon2PasswordEncoder.defaultsForSpringSecurity_v5_8();   // Alternatively BCrypt strength 10–12 and an input length cap

Further reading