The vulnerability arises from the error message behavior in the authenticate method. Before the patch, when a login attempt failed due to an incorrect password, the error message explicitly included the username (e.g., 'Failed to login as alice'). This allowed attackers to distinguish between invalid usernames (which would trigger a UsernameNotFoundException) and valid usernames with incorrect passwords (which would trigger a BadCredentialsException containing the username). The commit diff shows the fix modified the authenticate method to use a generic error message, confirming this as the source of the vulnerability. While the CVE title mentions loadUserByUsername, the actual information leak occurs in authenticate's error handling.