The vulnerability, identified as CVE-2025-6004, allows an attacker to bypass user lockout mechanisms in OpenBao's LDAP and userpass authentication methods. The root cause is an inconsistency in how user aliases are generated and handled between the initial user lockout check (the 'alias lookahead') and the actual login process.
An attacker could provide a username with variations, such as leading/trailing whitespace or different character casing (e.g., ' user ' or 'User' instead of 'user'). The alias lookahead logic, which is responsible for checking if an account is locked, did not normalize these variations. However, the backend authentication systems (LDAP/userpass) might still resolve these variations to the same user account.
This discrepancy allowed an attacker to repeatedly attempt to log in with these username variations. Each attempt would be seen as a login for a different user by the lockout mechanism, thus never incrementing the failure count for the actual user account and never triggering a lockout.
The patch addresses this by implementing two key changes:
- Username Normalization: The
pathLoginAliasLookahead and pathLogin functions in both the ldap and userpass auth methods are modified to normalize usernames by trimming whitespace and converting them to lowercase. This ensures that variations of a username are treated as a single identity.
- Consistent Alias Propagation: The core request handling logic in
vault/request_handling.go is refactored. The user alias information generated during the initial isUserLocked check is now captured and passed consistently throughout the entire login process, including to the failedUserLoginProcess and token creation functions. This guarantees that the same user alias is used for checking the lock status, recording failed attempts, and clearing failed attempts upon a successful login.
By enforcing consistent alias generation and propagation, the patch closes the loophole that allowed the user lockout mechanism to be bypassed.