Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Reject login attempt with 426 for upgraded account encryption type (#2469)
Leendert de Borstb0ab554682e2
diff --git a/apps/server/AliasVault.Api/Controllers/V1/AuthController.cs b/apps/server/AliasVault.Api/Controllers/V1/AuthController.csindex 4d237b9ef..f0864d7fd 100644--- a/apps/server/AliasVault.Api/Controllers/V1/AuthController.cs+++ b/apps/server/AliasVault.Api/Controllers/V1/AuthController.cs@@ -162,6 +162,12 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserMawait using var context = await dbContextFactory.CreateDbContextAsync();var latestVaultEncryptionSettings = await AuthHelper.GetUserLatestVaultEncryptionSettingsAsync(context, user);+ // A v1 client can only answer a legacy verifier; for an upgraded one it would report a wrong password.+ if (latestVaultEncryptionSettings.EncryptionType != Defaults.LegacyEncryptionType)+ {+ return StatusCode(426, new { error = "UPGRADE_REQUIRED", message = "Your client is out of date. Please update to access this vault." });+ }+var srpIdentity = AuthHelper.GetSrpIdentity(user);// Server creates ephemeral and sends to client@@ -1005,7 +1011,7 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserMreturn Ok(new LoginInitiateResponse(fakeData.Salt,fakeEphemeral.Public,- Defaults.EncryptionType,+ Defaults.LegacyEncryptionType,Defaults.EncryptionSettings,fakeData.SrpIdentity));}