Browse Source

Limit re-check to ShouldChangePassword users to avoid leaking password oracle on other NotAllowed branches

pull/25482/head
maliming 2 months ago
parent
commit
eefdad7402
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 4
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs

4
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml.cs

@ -137,7 +137,9 @@ public class LoginModel : AccountPageModel
using (CurrentTenant.Change(notAllowedUser.TenantId))
{
await IdentityOptions.SetAsync();
if (!await UserManager.CheckPasswordAsync(notAllowedUser, LoginInput.Password))
if ((notAllowedUser.ShouldChangePasswordOnNextLogin ||
await UserManager.ShouldPeriodicallyChangePasswordAsync(notAllowedUser)) &&
!await UserManager.CheckPasswordAsync(notAllowedUser, LoginInput.Password))
{
Alerts.Danger(L["InvalidUserNameOrPassword"]);
return Page();

Loading…
Cancel
Save