The analysis of the provided commits clearly indicates that the vulnerability lies within the GetPasswordConfig method in AuthenticationController.cs. The vulnerability description states that an anonymously authenticated endpoint can retrieve password requirement information. The code patches confirm this by altering the logic of the GetPasswordConfig function.
Before the patch, the function would return password configuration details even if the user was not authenticated. The line currentUserId.Success ? currentUserId.Result != userId : true is the culprit; for an unauthenticated user, currentUserId.Success is false, which resulted in _passwordConfiguration.GetConfiguration(true) being executed, thereby leaking the password policy.
The fix introduces a session-based check (HasActivePasswordResetFlowSession) to ensure that password configuration is only revealed during a legitimate password reset process. For any other unauthenticated request, the function now returns an empty dictionary, effectively patching the information disclosure vulnerability. The other modified functions (PostLogin, PostRequestPasswordReset, PostSetPassword, ValidatePasswordResetCode) and the new extension methods in HttpContextExtensions.cs are all part of the mitigation logic to manage the password reset session state and are not themselves vulnerable.