← Java / Spring · Contents

JAVA-092 / Intermediate

Not using a Spring Security UserDetails password encoder (NoOp)

A02:2021 · CWE-256 Plaintext Storage · CWE-522 Insufficiently Protected Credentials

Why is this a problem?

{noop} or plaintext comparison remains in production.

How to fix it

java
User.withUsername(u).password(encoder.encode(raw)).roles("USER").build();   // BCrypt/Argon2

Further reading