← Java / Spring · Contents

JAVA-052 / Beginner

Revealing account existence through different responses

A07:2021 Identification and Authentication Failures · CWE-204 Observable Response Discrepancy

Why is this a problem?

A message such as "Account does not exist" enables collection of member lists.

How to fix it

java
// Always respond identically: "Instructions have been sent to the address you entered."
return ResponseEntity.accepted().build();

Further reading