Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Remove deprecated client action queue
Leendert de Borst43f1f605ea45
diff --git a/apps/server/AliasVault.Api/Controllers/V2/ClientActionsController.cs b/apps/server/AliasVault.Api/Controllers/V2/ClientActionsController.csdeleted file mode 100644index 53782e401..000000000--- a/apps/server/AliasVault.Api/Controllers/V2/ClientActionsController.cs+++ /dev/null@@ -1,59 +0,0 @@-//------------------------------------------------------------------------// <copyright file="ClientActionsController.cs" company="aliasvault">-// Copyright (c) aliasvault. All rights reserved.-// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.-// </copyright>-//-------------------------------------------------------------------------namespace AliasVault.Api.Controllers.V2;--using AliasServerDb;-using AliasVault.Api.Controllers.Abstracts;-using AliasVault.Api.Helpers;-using AliasVault.Shared.Models.Enums;-using AliasVault.Shared.Models.WebApi;-using Asp.Versioning;-using Microsoft.AspNetCore.Identity;-using Microsoft.AspNetCore.Mvc;-using Microsoft.EntityFrameworkCore;--/// <summary>-/// Client action queue controller.-/// </summary>-/// <param name="dbContextFactory">The database context factory.</param>-/// <param name="userManager">The user manager.</param>-[ApiVersion("2")]-public class ClientActionsController(IAliasServerDbContextFactory dbContextFactory, UserManager<AliasVaultUser> userManager) : AuthenticatedRequestController(userManager)-{- /// <summary>- /// Report an action carried out, which removes it from the queue.- /// </summary>- /// <param name="id">The action ID.</param>- /// <returns>Ok when the action is no longer outstanding.</returns>- [HttpDelete("{id:guid}")]- public async Task<IActionResult> Complete(Guid id)- {- await using var context = await dbContextFactory.CreateDbContextAsync();- var me = await GetCurrentUserAsync();- if (me == null)- {- return ApiError.Result(ApiErrorCode.NOT_AUTHENTICATED, 401);- }-- var action = await context.ClientActions.FirstOrDefaultAsync(a => a.Id == id);- if (action is null)- {- return Ok();- }-- if (!await ClientActionHelper.CanCompleteAsync(context, action, me.Id))- {- return ApiError.Result(ApiErrorCode.CLIENT_ACTION_NOT_FOUND, 404);- }-- context.ClientActions.Remove(action);- await context.SaveChangesAsync();-- return Ok();- }-}diff --git a/apps/server/AliasVault.Api/Controllers/V2/GroupsController.cs b/apps/server/AliasVault.Api/Controllers/V2/GroupsController.csindex c646533b7..3b6df901e 100644--- a/apps/server/AliasVault.Api/Controllers/V2/GroupsController.cs+++ b/apps/server/AliasVault.Api/Controllers/V2/GroupsController.cs@@ -1233,8 +1233,8 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use}/// <summary>- /// Delete a shared manifest with its grants, keys, open invitations and queued client actions, and its group once it- /// owns no other manifest. Runs inside the caller's transaction, under the group's member lock.+ /// Delete a shared manifest with its grants, keys and open invitations, and its group once it owns no other manifest.+ /// Runs inside the caller's transaction, under the group's member lock./// </summary>/// <param name="context">The database context, inside the open transaction.</param>/// <param name="groupId">The group.</param>@@ -1262,13 +1262,12 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Useawait context.SaveChangesAsync();- // Key rows and queued client actions reference the manifest without a cascading foreign key, so leftovers are deleted explicitly.+ // Key rows reference the manifest without a cascading foreign key, so leftovers are deleted explicitly.await context.VaultManifestAccessKeys.Where(k => k.VaultManifestId == manifestId).ExecuteDeleteAsync();- await context.ClientActions.Where(a => a.ManifestId == manifestId).ExecuteDeleteAsync();context.VaultManifests.Remove(manifest);await context.SaveChangesAsync();- // The group exists for its shared manifest; memberships, invitations, client actions and quota rows cascade from it.+ // The group exists for its shared manifest; memberships, invitations and quota rows cascade from it.if (!await context.VaultManifests.AnyAsync(m => m.OwnerGroupId == groupId)){await context.Groups.Where(g => g.Id == groupId && g.Type == GroupType.Shared).ExecuteDeleteAsync();@@ -1358,8 +1357,8 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, Use}/// <summary>- /// Close a member's open invitation and grant on a shared manifest in one transaction, and have the group rotate the- /// manifest's delivery key. The lock keeps the last-holder check true until commit.+ /// Close a member's open invitation and grant on a shared manifest in one transaction. The lock keeps the last-holder+ /// check true until commit./// </summary>/// <param name="context">The database context.</param>/// <param name="groupId">The group ID.</param>@@ -1385,10 +1384,7 @@ public class GroupsController(IAliasServerDbContextFactory dbContextFactory, UseCloseInvitation(invitation, VaultManifestInvitationState.Revoked);}- if (await GrantHelper.RevokeAccessAsync(context, manifestId, userId))- {- await ClientActionHelper.EnqueueForGroupAsync(context, ClientActionType.RotateManifestDeliveryKey, groupId, manifestId, timeProvider.GetUtcNow().UtcDateTime);- }+ await GrantHelper.RevokeAccessAsync(context, manifestId, userId);// The group is the people the shared manifest is shared with, so losing access to it is leaving the group.await context.SaveChangesAsync();diff --git a/apps/server/AliasVault.Api/Controllers/V2/StatusController.cs b/apps/server/AliasVault.Api/Controllers/V2/StatusController.csindex d39efb515..ef83c5482 100644--- a/apps/server/AliasVault.Api/Controllers/V2/StatusController.cs+++ b/apps/server/AliasVault.Api/Controllers/V2/StatusController.cs@@ -83,7 +83,6 @@ public class StatusController(IAliasServerDbContextFactory dbContextFactory, UsePersonalManifestId = personalManifestId,BucketRevisions = bucketRevisions,Capabilities = await capabilityService.GetCapabilitiesAsync(user.Id, ClientHeader),- PendingActions = await ClientActionHelper.GetPendingActionsAsync(context, user.Id),EmailDomains = EmailDomainHelper.GetEmailDomains(config),PendingSharingInvitations = await GroupHelper.CountOpenInvitationsAsync(context, user.Id, timeProvider.GetUtcNow().UtcDateTime - GroupHelper.InvitationLifetime),});diff --git a/apps/server/AliasVault.Api/Helpers/ClientActionHelper.cs b/apps/server/AliasVault.Api/Helpers/ClientActionHelper.csdeleted file mode 100644index 9a2dc89f4..000000000--- a/apps/server/AliasVault.Api/Helpers/ClientActionHelper.cs+++ /dev/null@@ -1,85 +0,0 @@-//------------------------------------------------------------------------// <copyright file="ClientActionHelper.cs" company="aliasvault">-// Copyright (c) aliasvault. All rights reserved.-// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.-// </copyright>-//-------------------------------------------------------------------------namespace AliasVault.Api.Helpers;--using AliasServerDb;-using AliasVault.Shared.Models.WebApi.V2;-using AliasVault.Shared.Models.WebApi.V2.ClientActions;-using Microsoft.EntityFrameworkCore;--/// <summary>-/// The queue of work the server hands to clients: things that became necessary because of something outside a-/// client's own context, and that only a client can finish because they need vault content or a key the server does not hold.-/// </summary>-public static class ClientActionHelper-{- /// <summary>- /// Get the actions addressed to a user.- /// </summary>- /// <param name="context">The database context.</param>- /// <param name="userId">The user ID.</param>- /// <returns>The outstanding actions, oldest first.</returns>- public static async Task<List<PendingClientAction>> GetPendingActionsAsync(AliasServerDbContext context, string userId)- {- var administeredGroupIds = await GroupHelper.GetAdministeredGroupIdsAsync(context, userId);- var actions = await context.ClientActions- .Where(a => a.TargetUserId == userId || (a.TargetGroupId != null && administeredGroupIds.Contains(a.TargetGroupId.Value)))- .OrderBy(a => a.CreatedAt)- .ToListAsync();-- return actions.ConvertAll(a => new PendingClientAction { Id = a.Id, Type = KebabCaseEnumConverter.ToToken(a.Type), ManifestId = a.ManifestId, Payload = a.Payload });- }-- /// <summary>- /// Whether the user is one of the clients this action is addressed to, and may therefore report it done.- /// </summary>- /// <param name="context">The database context.</param>- /// <param name="action">The action.</param>- /// <param name="userId">The user ID.</param>- /// <returns>True when the user may complete it.</returns>- public static async Task<bool> CanCompleteAsync(AliasServerDbContext context, ClientAction action, string userId)- {- if (string.Equals(action.TargetUserId, userId, StringComparison.Ordinal))- {- return true;- }-- return action.TargetGroupId is not null && await GroupHelper.IsGroupAdminAsync(context, action.TargetGroupId.Value, userId);- }-- /// <summary>- /// Record work for the admins of a group, without queueing the same thing twice.- /// </summary>- /// <param name="context">The database context.</param>- /// <param name="type">The work to be done.</param>- /// <param name="groupId">The group ID.</param>- /// <param name="manifestId">The manifest ID (optional).</param>- /// <param name="now">The current time.</param>- /// <returns>The queued action, or the one already outstanding.</returns>- public static async Task<ClientAction> EnqueueForGroupAsync(AliasServerDbContext context, ClientActionType type, Guid groupId, Guid? manifestId, DateTime now)- {- var existing = await context.ClientActions.FirstOrDefaultAsync(a => a.Type == type && a.TargetGroupId == groupId && a.ManifestId == manifestId);- if (existing is not null)- {- return existing;- }-- var action = new ClientAction- {- Id = Guid.NewGuid(),- Type = type,- TargetGroupId = groupId,- ManifestId = manifestId,- CreatedAt = now,- UpdatedAt = now,- };-- context.ClientActions.Add(action);- return action;- }-}diff --git a/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs b/apps/server/Databases/AliasServerDb/AliasServerDbContext.csindex 614c36acc..e50334253 100644--- a/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs+++ b/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs@@ -121,11 +121,6 @@ public class AliasServerDbContext : WorkerStatusDbContext, IDataProtectionKeyCon/// </summary>public DbSet<VaultManifestInvitation> VaultManifestInvitations { get; set; }- /// <summary>- /// Gets or sets the ClientActions DbSet.- /// </summary>- public DbSet<ClientAction> ClientActions { get; set; }-/// <summary>/// Gets or sets the VaultManifestShareDetails DbSet./// </summary>@@ -396,23 +391,6 @@ public class AliasServerDbContext : WorkerStatusDbContext, IDataProtectionKeyCon.OnDelete(DeleteBehavior.SetNull);});- // Configure ClientAction, a work the server needs a client to carry out on its behalf.- modelBuilder.Entity<ClientAction>(builder =>- {- builder.HasOne(e => e.TargetUser)- .WithMany()- .HasForeignKey(e => e.TargetUserId)- .OnDelete(DeleteBehavior.Cascade);-- builder.HasOne(e => e.TargetGroup)- .WithMany()- .HasForeignKey(e => e.TargetGroupId)- .OnDelete(DeleteBehavior.Cascade);-- builder.Property(e => e.Type).HasConversion<string>().HasMaxLength(50);- builder.Property(e => e.Payload).HasColumnType("jsonb");- });-// Configure VaultManifest: one row per logical manifest (current revision), keyed by ManifestId.modelBuilder.Entity<VaultManifest>(builder =>{diff --git a/apps/server/Databases/AliasServerDb/ClientAction.cs b/apps/server/Databases/AliasServerDb/ClientAction.csdeleted file mode 100644index 0649858ad..000000000--- a/apps/server/Databases/AliasServerDb/ClientAction.cs+++ /dev/null@@ -1,77 +0,0 @@-//------------------------------------------------------------------------// <copyright file="ClientAction.cs" company="aliasvault">-// Copyright (c) aliasvault. All rights reserved.-// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.-// </copyright>-//-------------------------------------------------------------------------namespace AliasServerDb;--using System.ComponentModel.DataAnnotations;-using System.ComponentModel.DataAnnotations.Schema;-using Microsoft.EntityFrameworkCore;--/// <summary>-/// A piece of work the server needs a client to carry out, because something happened outside that client's own-/// context and only a client can finish it: anything requiring vault content, a vault key or a private key is the-/// server's to notice and the client's to do.-/// </summary>-[Index(nameof(TargetUserId))]-[Index(nameof(TargetGroupId))]-public class ClientAction-{- /// <summary>- /// Gets or sets the primary key, which is also the handle a client completes the action by.- /// </summary>- [Key]- public Guid Id { get; set; }-- /// <summary>- /// Gets or sets what has to be done.- /// </summary>- [StringLength(50)]- public required ClientActionType Type { get; set; }-- /// <summary>- /// Gets or sets the single account that must carry the action out (optional).- /// </summary>- [StringLength(255)]- public string? TargetUserId { get; set; }-- /// <summary>- /// Gets or sets the navigation property to the targeted account.- /// </summary>- [ForeignKey("TargetUserId")]- public virtual AliasVaultUser? TargetUser { get; set; }-- /// <summary>- /// Gets or sets the group whose admins must carry the action out (optional).- /// </summary>- public Guid? TargetGroupId { get; set; }-- /// <summary>- /// Gets or sets the navigation property to the targeted group.- /// </summary>- [ForeignKey("TargetGroupId")]- public virtual Group? TargetGroup { get; set; }-- /// <summary>- /// Gets or sets the manifest the action is about (optional).- /// </summary>- public Guid? ManifestId { get; set; }-- /// <summary>- /// Gets or sets action-specific parameters as JSON, or null when the type and its subject say everything.- /// </summary>- public string? Payload { get; set; }-- /// <summary>- /// Gets or sets created timestamp, i.e. when the server noticed the work was needed.- /// </summary>- public DateTime CreatedAt { get; set; }-- /// <summary>- /// Gets or sets updated timestamp.- /// </summary>- public DateTime UpdatedAt { get; set; }-}diff --git a/apps/server/Databases/AliasServerDb/ClientActionType.cs b/apps/server/Databases/AliasServerDb/ClientActionType.csdeleted file mode 100644index 59c86f574..000000000--- a/apps/server/Databases/AliasServerDb/ClientActionType.cs+++ /dev/null@@ -1,21 +0,0 @@-//------------------------------------------------------------------------// <copyright file="ClientActionType.cs" company="aliasvault">-// Copyright (c) aliasvault. All rights reserved.-// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.-// </copyright>-//-------------------------------------------------------------------------namespace AliasServerDb;--/// <summary>-/// The kinds of work a <see cref="ClientAction"/> can ask a client to carry out.-/// </summary>-public enum ClientActionType-{- /// <summary>- /// The delivery keypair of a shared manifest has to be replaced, because a user who previously had access to- /// its private half was removed from the owning group. Note: this is different from access to mail, as a user that- /// is not part of a group anymore won't be able to fetch mail of the group's owned email aliases.- /// </summary>- RotateManifestDeliveryKey = 0,-}diff --git a/apps/server/Databases/AliasServerDb/Migrations/20261022102104_RenameGroupInvitationsToVaultManifestInvitations.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20261022102104_RenameGroupInvitationsToVaultManifestInvitations.Designer.csindex 34bb3c068..4746171f0 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20261022102104_RenameGroupInvitationsToVaultManifestInvitations.Designer.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20261022102104_RenameGroupInvitationsToVaultManifestInvitations.Designer.cs@@ -412,45 +412,6 @@ namespace AliasServerDb.Migrationsb.ToTable("CapabilityRules");});- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Payload")- .HasColumnType("jsonb");-- b.Property<Guid?>("TargetGroupId")- .HasColumnType("uuid");-- b.Property<string>("TargetUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("TargetGroupId");-- b.HasIndex("TargetUserId");-- b.ToTable("ClientActions");- });-modelBuilder.Entity("AliasServerDb.Email", b =>{b.Property<int>("Id")@@ -1927,23 +1888,6 @@ namespace AliasServerDb.Migrationsb.Navigation("User");});- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.HasOne("AliasServerDb.Group", "TargetGroup")- .WithMany()- .HasForeignKey("TargetGroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")- .WithMany()- .HasForeignKey("TargetUserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("TargetGroup");-- b.Navigation("TargetUser");- });-modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>{b.HasOne("AliasServerDb.Email", "Email")diff --git a/apps/server/Databases/AliasServerDb/Migrations/20261022102104_RenameGroupInvitationsToVaultManifestInvitations.cs b/apps/server/Databases/AliasServerDb/Migrations/20261022102104_RenameGroupInvitationsToVaultManifestInvitations.csindex 3f2d711fb..a51c155c3 100644--- a/apps/server/Databases/AliasServerDb/Migrations/20261022102104_RenameGroupInvitationsToVaultManifestInvitations.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/20261022102104_RenameGroupInvitationsToVaultManifestInvitations.cs@@ -7,7 +7,7 @@ namespace AliasServerDb.Migrations{/// <summary>/// Every server schema change after 0.31.1 in one migration: renames UserUnlockKeys to UserUnlockMethods and GroupInvitations to- /// VaultManifestInvitations in place, adds the signing key fingerprint and previous-key signature, and adds UserKeyCertifications.+ /// VaultManifestInvitations in place, adds the signing key fingerprint and previous-key signature, adds UserKeyCertifications and drops ClientActions./// </summary>public partial class RenameGroupInvitationsToVaultManifestInvitations : Migration{@@ -112,11 +112,36 @@ namespace AliasServerDb.MigrationsmigrationBuilder.RenameIndex(name: "IX_GroupInvitations_UserGrantKeyId", table: "VaultManifestInvitations", newName: "IX_VaultManifestInvitations_UserGrantKeyId");migrationBuilder.RenameIndex(name: "UX_GroupInvitations_Manifest_Invitee_Pending", table: "VaultManifestInvitations", newName: "UX_VaultManifestInvitations_Manifest_Invitee_Pending");migrationBuilder.AlterColumn<Guid>(name: "VaultManifestId", table: "VaultManifestInvitations", type: "uuid", nullable: false, oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true);++ // Its only action type, the delivery key rotation on member removal, was removed; queued rows have no reader left.+ migrationBuilder.DropTable(name: "ClientActions");}/// <inheritdoc />protected override void Down(MigrationBuilder migrationBuilder){+ migrationBuilder.CreateTable(+ name: "ClientActions",+ columns: table => new+ {+ Id = table.Column<Guid>(type: "uuid", nullable: false),+ Type = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),+ TargetUserId = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),+ TargetGroupId = table.Column<Guid>(type: "uuid", nullable: true),+ ManifestId = table.Column<Guid>(type: "uuid", nullable: true),+ Payload = table.Column<string>(type: "jsonb", nullable: true),+ CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),+ UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)+ },+ constraints: table =>+ {+ table.PrimaryKey("PK_ClientActions", x => x.Id);+ table.ForeignKey(name: "FK_ClientActions_AliasVaultUsers_TargetUserId", column: x => x.TargetUserId, principalTable: "AliasVaultUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade);+ table.ForeignKey(name: "FK_ClientActions_Groups_TargetGroupId", column: x => x.TargetGroupId, principalTable: "Groups", principalColumn: "Id", onDelete: ReferentialAction.Cascade);+ });+ migrationBuilder.CreateIndex(name: "IX_ClientActions_TargetGroupId", table: "ClientActions", column: "TargetGroupId");+ migrationBuilder.CreateIndex(name: "IX_ClientActions_TargetUserId", table: "ClientActions", column: "TargetUserId");+migrationBuilder.AlterColumn<Guid>(name: "VaultManifestId", table: "VaultManifestInvitations", type: "uuid", nullable: true, oldClrType: typeof(Guid), oldType: "uuid");migrationBuilder.RenameIndex(name: "UX_VaultManifestInvitations_Manifest_Invitee_Pending", table: "VaultManifestInvitations", newName: "UX_GroupInvitations_Manifest_Invitee_Pending");migrationBuilder.RenameIndex(name: "IX_VaultManifestInvitations_UserGrantKeyId", table: "VaultManifestInvitations", newName: "IX_GroupInvitations_UserGrantKeyId");diff --git a/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.csindex 701a33d65..7e968fea3 100644--- a/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs+++ b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs@@ -409,45 +409,6 @@ namespace AliasServerDb.Migrationsb.ToTable("CapabilityRules");});- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.Property<Guid>("Id")- .ValueGeneratedOnAdd()- .HasColumnType("uuid");-- b.Property<DateTime>("CreatedAt")- .HasColumnType("timestamp with time zone");-- b.Property<Guid?>("ManifestId")- .HasColumnType("uuid");-- b.Property<string>("Payload")- .HasColumnType("jsonb");-- b.Property<Guid?>("TargetGroupId")- .HasColumnType("uuid");-- b.Property<string>("TargetUserId")- .HasMaxLength(255)- .HasColumnType("character varying(255)");-- b.Property<string>("Type")- .IsRequired()- .HasMaxLength(50)- .HasColumnType("character varying(50)");-- b.Property<DateTime>("UpdatedAt")- .HasColumnType("timestamp with time zone");-- b.HasKey("Id");-- b.HasIndex("TargetGroupId");-- b.HasIndex("TargetUserId");-- b.ToTable("ClientActions");- });-modelBuilder.Entity("AliasServerDb.Email", b =>{b.Property<int>("Id")@@ -1924,23 +1885,6 @@ namespace AliasServerDb.Migrationsb.Navigation("User");});- modelBuilder.Entity("AliasServerDb.ClientAction", b =>- {- b.HasOne("AliasServerDb.Group", "TargetGroup")- .WithMany()- .HasForeignKey("TargetGroupId")- .OnDelete(DeleteBehavior.Cascade);-- b.HasOne("AliasServerDb.AliasVaultUser", "TargetUser")- .WithMany()- .HasForeignKey("TargetUserId")- .OnDelete(DeleteBehavior.Cascade);-- b.Navigation("TargetGroup");-- b.Navigation("TargetUser");- });-modelBuilder.Entity("AliasServerDb.EmailAttachment", b =>{b.HasOne("AliasServerDb.Email", "Email")diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/ClientActions/PendingClientAction.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/ClientActions/PendingClientAction.csdeleted file mode 100644index f06efe71e..000000000--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/ClientActions/PendingClientAction.cs+++ /dev/null@@ -1,27 +0,0 @@-//------------------------------------------------------------------------// <copyright file="PendingClientAction.cs" company="aliasvault">-// Copyright (c) aliasvault. All rights reserved.-// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.-// </copyright>-//-------------------------------------------------------------------------namespace AliasVault.Shared.Models.WebApi.V2.ClientActions;--/// <summary>-/// A piece of generic work the server needs a client to carry out due to the E2EE model. This primarily affects vault sharing-/// and revocation actions.-/// </summary>-public class PendingClientAction-{- /// <summary>Gets or sets the action id, the handle it is reported done by.</summary>- public required Guid Id { get; set; }-- /// <summary>Gets or sets what has to be done, as a token (see the server's <c>ClientActionType</c>).</summary>- public required string Type { get; set; }-- /// <summary>Gets or sets the manifest the action is about (optional).</summary>- public Guid? ManifestId { get; set; }-- /// <summary>Gets or sets the optional action-specific parameters as raw JSON.</summary>- public string? Payload { get; set; }-}diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Status/StatusResponse.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Status/StatusResponse.csindex 82a094d79..681a76c27 100644--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Status/StatusResponse.cs+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/V2/Status/StatusResponse.cs@@ -7,7 +7,6 @@namespace AliasVault.Shared.Models.WebApi.V2.Status;-using AliasVault.Shared.Models.WebApi.V2.ClientActions;using AliasVault.Shared.Models.WebApi.V2.Vault;/// <summary>@@ -54,12 +53,6 @@ public class StatusResponse/// </summary>public Dictionary<string, string> Capabilities { get; set; } = [];- /// <summary>- /// Gets or sets the work the server needs this client to carry out, because it needs something only a client has:- /// vault content, a vault key, a private key. This primarily affects vault sharing and revocation actions.- /// </summary>- public List<PendingClientAction> PendingActions { get; set; } = [];-/// <summary>/// Gets or sets the email domains this server serves, so clients pick up a domain change without a vault pull./// </summary>diff --git a/core/models/src/webapi/StatusResponseV2.ts b/core/models/src/webapi/StatusResponseV2.tsindex ac66ce750..5c48bb25b 100644--- a/core/models/src/webapi/StatusResponseV2.ts+++ b/core/models/src/webapi/StatusResponseV2.ts@@ -19,17 +19,6 @@ export type BucketRevision = {revision: number;}-/**- * A piece of work the server needs this client to carry out, because it needs something only a client holds- * (vault content, a vault key, a private key).- */-export type PendingClientAction = {- id: string;- type: string;- manifestId?: string | null;- payload?: string | null;-}-/*** The email domains a server serves; hidden private domains are also in the private list.*/@@ -50,7 +39,6 @@ export type StatusResponseV2 = {srpSalt: string;capabilities?: Record<string, string>;bucketRevisions?: BucketRevision[];- pendingActions?: PendingClientAction[];emailDomains?: EmailDomains;pendingSharingInvitations?: number;}diff --git a/core/rust/src/vault_sync/engine.rs b/core/rust/src/vault_sync/engine.rsindex 54afbaf1f..84ba16ec9 100644--- a/core/rust/src/vault_sync/engine.rs+++ b/core/rust/src/vault_sync/engine.rs@@ -13,16 +13,12 @@ use super::session::Host;use super::state::{self, Ctx};use super::types::{FailureFields, FullSyncResult, LogLevel, ResolveVaultKeyResult, StatusCheckResult, StatusResponse, SyncOperation, SyncRequest};use super::{db, http, keys, migration, rotation, sharing};-use crate::crypto;-use crate::vault_model::{id_key, ids_equal};+use crate::vault_model::id_key;/// How many times a chain of syncs may re-sync after an outdated push before giving up. Two clients pushing at the/// same time race on the server's revision gate; the loser pulls, merges and pushes again, up to this many times.const MAX_OUTDATED_RESYNCS: u32 = 3;-/// The pending action type this build carries out.-const ACTION_ROTATE_MANIFEST_DELIVERY_KEY: &str = "rotate-manifest-delivery-key";-/// Run one operation to completion; the value is the `done` command's result.pub(crate) async fn run(host: Host, request: SyncRequest) -> Value {let mut ctx = Ctx::new(host, request);@@ -153,8 +149,7 @@ async fn full_sync_once(ctx: &mut Ctx) -> SyncResult<Flow> {}announce_phase(ctx, needs_pull, ctx.is_dirty).await;- let names_changed = refresh_manifest_names(ctx, &status, needs_pull).await?;- let server_directed_changes = apply_server_directed_changes(ctx, &status).await? || names_changed;+ let server_directed_changes = refresh_manifest_names(ctx, &status, needs_pull).await?;// A dirty vault on the current schema: drop the dirty flag when nothing changed, and pull first when it holds// rows this session cannot write (a share that was revoked), since a push would refuse them.@@ -355,52 +350,6 @@ async fn refresh_manifest_names(ctx: &mut Ctx, status: &StatusResponse, needs_puOk(true)}-/// Carry out the pending actions the server queued for this client.-async fn apply_server_directed_changes(ctx: &mut Ctx, status: &StatusResponse) -> SyncResult<bool> {- if status.pending_actions.is_empty() || !ctx.has_local_vault().await? || migration::vault_requires_manifest_migration(ctx).await? {- return Ok(false);- }- let shared = keys::shared_manifest_records(ctx).await?;- let mut vault_changed = false;- let mut completed = 0usize;- for action in &status.pending_actions {- if action.action_type != ACTION_ROTATE_MANIFEST_DELIVERY_KEY {- ctx.log(format!("[Sync] Action type {} is not known to this client; leaving it for one that knows it.", action.action_type)).await;- continue;- }- let record = shared.values().find(|r| action.manifest_id.as_deref().is_some_and(|id| ids_equal(id, &r.manifest_id))).filter(|r| r.can_administer);- let Some(record) = record else {- ctx.log(format!("[Sync] Manifest {:?} is not open to this session as an administrator; leaving its delivery key rotation for another sync.", action.manifest_id)).await;- continue;- };- let rotated: SyncResult<()> = async {- let pair = crypto::generate_rsa_key_pair()?;- db::set_active_key_for_manifest(&ctx.host, &record.manifest_id, &pair.public_key, &pair.private_key).await?;- http::delete(&ctx.host, &format!("ClientActions/{}", action.id)).await- }- .await;- match rotated {- Ok(()) => {- ctx.log(format!("[Sync] Rotated the mail delivery key of shared manifest {}.", record.manifest_id)).await;- vault_changed = true;- completed += 1;- }- Err(error) => ctx.warn(format!("[Sync] Could not carry out action {} ({}); retrying on the next sync. {}", action.action_type, action.id, error)).await,- }- }- ctx.log(format!("[Sync] {} of {} server-directed action(s) carried out.", completed, status.pending_actions.len())).await;-- if vault_changed {- let was_dirty = ctx.is_dirty;- ctx.persist_local_vault(true).await?;- if !was_dirty {- // The reconciled rows ride out on this very sync, which the host had not announced as a push yet.- announce_phase(ctx, false, true).await;- }- }- Ok(vault_changed)-}-/// Outcome for a sync that stored a freshly pulled vault.async fn materialized_vault_result(ctx: &mut Ctx, pulled: &PulledVault) -> SyncResult<FullSyncResult> {let migration_required = migration::vault_requires_manifest_migration(ctx).await?;diff --git a/core/rust/src/vault_sync/http.rs b/core/rust/src/vault_sync/http.rsindex 28cda9e54..da5c6de32 100644--- a/core/rust/src/vault_sync/http.rs+++ b/core/rust/src/vault_sync/http.rs@@ -90,12 +90,6 @@ pub(crate) async fn post_no_content<B: Serialize>(host: &Host, path: &str, body:Ok(())}-/// Authenticated DELETE of a v2 endpoint.-pub(crate) async fn delete(host: &Host, path: &str) -> SyncResult<()> {- send_json(host, HttpMethod::Delete, path, Body::None, false).await?;- Ok(())-}-/// Authenticated GET of a v2 endpoint that answers with a binary frame.pub(crate) async fn get_frame<T: FrameBody + DeserializeOwned>(host: &Host, path: &str) -> SyncResult<T> {send_for_frame(host, HttpMethod::Get, path, Body::None).awaitdiff --git a/core/rust/src/vault_sync/tests/fake_server.rs b/core/rust/src/vault_sync/tests/fake_server.rsindex 9c6148ba3..dbb25f09c 100644--- a/core/rust/src/vault_sync/tests/fake_server.rs+++ b/core/rust/src/vault_sync/tests/fake_server.rs@@ -76,7 +76,6 @@ pub struct FakeServer {/// The `vaultKey` of `GET VaultKey/Password`; `Null` for an account without a key hierarchy.pub vault_key: Value,pub legacy: Option<LegacyVault>,- pub pending_actions: Vec<Value>,pub capabilities: Value,pub email_domains: Value,pub faults: Faults,@@ -93,7 +92,6 @@ impl FakeServer {blobs: HashMap::new(),vault_key: Value::Null,legacy: None,- pending_actions: Vec::new(),capabilities: json!({ "sharing": "on" }),email_domains: json!({ "privateEmailDomainList": ["private.io"], "hiddenPrivateEmailDomainList": [], "publicEmailDomainList": [] }),faults: Faults::default(),@@ -233,11 +231,6 @@ impl FakeServer {("POST", "Vault/blobs/missing") => Some((200, self.missing_blobs(body?))),("POST", "Vault/blobs/download") => Some((200, self.download_blobs(body?))),("GET", "VaultKey/Password") => Some((200, json!({ "vaultKey": self.vault_key }))),- ("DELETE", path) if path.starts_with("ClientActions/") => {- let id = &path["ClientActions/".len()..];- self.pending_actions.retain(|action| action["id"] != id);- Some((200, json!({})))- }_ => None,}}@@ -259,7 +252,6 @@ impl FakeServer {"personalManifestId": self.personal_manifest_id,"srpSalt": self.srp_salt,"capabilities": self.capabilities,- "pendingActions": self.pending_actions,"emailDomains": self.email_domains,})}diff --git a/core/rust/src/vault_sync/tests/sync.rs b/core/rust/src/vault_sync/tests/sync.rsindex 21a48b52d..7c1f20036 100644--- a/core/rust/src/vault_sync/tests/sync.rs+++ b/core/rust/src/vault_sync/tests/sync.rs@@ -4,7 +4,7 @@ use serde_json::{json, Value};use super::fake_server::{decrypt_manifest, FakeServer};use super::test_host::{request_json, TestHost, USERNAME};-use super::{active_delivery_keys, insert_item, insert_item_stats, rename_item, server_with_item, state, synced, ITEM_A, ITEM_B, ITEM_C, PERSONAL_MANIFEST_ID, SHARED_MANIFEST_ID};+use super::{active_delivery_keys, insert_item, insert_item_stats, rename_item, server_with_item, state, synced, ITEM_A, ITEM_B, ITEM_C, PERSONAL_MANIFEST_ID};use crate::crypto;use crate::vault_codec;use crate::vault_sync::session::SyncSession;@@ -232,28 +232,6 @@ fn push_creates_and_publishes_a_missing_personal_delivery_key() {assert_eq!(s.host.last_vault_write()["manifests"][0]["deliveryPublicKey"], json!(keys[0]));}-#[test]-fn a_server_queued_delivery_key_rotation_is_carried_out_and_acknowledged() {- // Only a known action for a manifest this session administers is carried out and deleted; the others stay queued.- let mut s = synced(|db| insert_item(db, ITEM_A, "Server item"));- let record = json!({ "manifestId": SHARED_MANIFEST_ID, "encryptedVek": "x", "accountPublicKey": "x", "algorithm": "rsa-oaep-sha256", "salt": "x", "canAdminister": true });- let records = json!({ SHARED_MANIFEST_ID: record });- s.host.set_state(state::SHARED_MANIFESTS, json!(crypto::symmetric_encrypt(&records.to_string(), &s.vek).unwrap()));- s.server.borrow_mut().pending_actions = vec![- json!({ "id": "a-rotate", "type": "rotate-manifest-delivery-key", "manifestId": SHARED_MANIFEST_ID }),- json!({ "id": "a-unknown", "type": "future-action", "manifestId": SHARED_MANIFEST_ID }),- json!({ "id": "a-foreign", "type": "rotate-manifest-delivery-key", "manifestId": "33333333-3333-4333-8333-333333333333" }),- ];-- let result = s.host.sync();-- assert_eq!(result["success"], true, "{}", result);- assert_eq!(s.host.request_log().into_iter().filter(|r| r.starts_with("DELETE")).collect::<Vec<_>>(), vec!["DELETE ClientActions/a-rotate"]);- let left: Vec<Value> = s.server.borrow().pending_actions.iter().map(|a| a["id"].clone()).collect();- assert_eq!(left, vec![json!("a-unknown"), json!("a-foreign")]);- assert_eq!(active_delivery_keys(&s.host.local, SHARED_MANIFEST_ID).len(), 1, "the shared manifest got a fresh delivery keypair");-}-#[test]fn bucket_only_push_writes_the_manifest_while_the_personal_delivery_key_is_missing() {let mut s = synced(|db| insert_item(db, ITEM_A, "Server item"));diff --git a/core/rust/src/vault_sync/types.rs b/core/rust/src/vault_sync/types.rsindex fa45785c4..98dc7427a 100644--- a/core/rust/src/vault_sync/types.rs+++ b/core/rust/src/vault_sync/types.rs@@ -495,8 +495,6 @@ pub struct StatusResponse {#[serde(default)]pub capabilities: Option<HashMap<String, String>>,#[serde(default)]- pub pending_actions: Vec<PendingAction>,- #[serde(default)]pub email_domains: Option<EmailDomainsDto>,#[serde(default)]pub pending_sharing_invitations: Option<i64>,@@ -522,16 +520,6 @@ pub struct BucketRevision {pub revision: i64,}-#[derive(Debug, Clone, Serialize, Deserialize)]-#[serde(rename_all = "camelCase")]-pub struct PendingAction {- pub id: String,- #[serde(rename = "type")]- pub action_type: String,- #[serde(default)]- pub manifest_id: Option<String>,-}-/// `GET v2/Vault`.#[derive(Debug, Clone, Default, Deserialize)]#[serde(rename_all = "camelCase")]diff --git a/docs/docs/security-architecture/securing-your-account.mdx b/docs/docs/security-architecture/securing-your-account.mdxindex 0ee6d5eb9..5442355b6 100644--- a/docs/docs/security-architecture/securing-your-account.mdx+++ b/docs/docs/security-architecture/securing-your-account.mdx@@ -45,7 +45,7 @@ Each device keeps an encrypted copy of your vault, so you can unlock it offline.## Shared vaults- **Only invite people you trust with everything in that vault.** A member can read and copy all of its contents. <WhitepaperRefs refs={[{section: '10', label: 'Vault sharing', anchor: '10-vault-sharing'}]} />-- **Removing a member does not take back what they already synced.** When the contents must be withheld from a former member, create a new shared vault, move the items into it, delete the old one, and change the passwords the member had access to. <WhitepaperRefs refs={[{section: '13', label: 'Known limitations', anchor: 'limitation-shared-member-removal'}]} />+- **Removing a member does not take back what they already synced.** Change the passwords the member had access to. To also move the vault to new keys, create a new shared vault, move the items and aliases into it, and delete the old one; emails received before the move are deleted with the old vault. <WhitepaperRefs refs={[{section: '13', label: 'Known limitations', anchor: 'limitation-shared-member-removal'}]} />- Your personal vault is never part of a shared vault, so sharing does not expose it.## Exportsdiff --git a/docs/docs/security-whitepaper.mdx b/docs/docs/security-whitepaper.mdxindex 53d9300f0..a74e8d90f 100644--- a/docs/docs/security-whitepaper.mdx+++ b/docs/docs/security-whitepaper.mdx@@ -70,7 +70,7 @@ The last column names the mechanism and the section that describes it.| **Malicious or compromised server** (operator, insider, intruder, leaked database or backups) | Reads and modifies everything the server stores; controls every API response; serves any public key, setting or version it likes | Read vault or stored email contents; learn the master password or any key; forge or alter vault contents undetected; move data between vaults, fields or users; make a client derive a key below the client-enforced minimum | Client-held key hierarchy ([4](#4-key-derivation-and-key-hierarchy)); AES-256-GCM bound to its slot ([4.1](#41-key-hierarchy), [6](#6-vault-operations)); other users' keys accepted only against their out-of-band provided account fingerprint, grants opened only when signed by the account itself ([10.3](#103-account-fingerprints-and-key-certifications)); client-side Argon2id minimum ([4](#4-key-derivation-and-key-hierarchy)); known limitations: rollback ([13.2](#limitation-rollback)), email on arrival ([2.2](#22-trust-assumptions)) || **Network attacker** (on-path, rogue access point, mis-issued certificate) | Reads and modifies traffic between client and server | Learn the password or any key; read vault contents; impersonate the server to a client during login | SRP with mutual proof ([5](#5-authentication-process)); vault data encrypted before transmission ([6](#6-vault-operations)); TLS || **Malicious website** visited while the extension is installed | Runs scripts in its own page, sends messages to the content script, calls the WebAuthn API | Obtain credentials or passkey signatures for another site; trigger autofill for another origin; read extension storage | Autofill suggestions matched on the registrable domain; one item released per user pick, only to the frame it was picked in; content-script isolation; WebAuthn origin and relying-party checks ([8](#8-passkey-authentication)) |-| **Another AliasVault user**, including current and former shared-vault members | Holds their own account, grants they were given, and copies of data they synced | Open a vault they were not invited to; read another user's personal vault; keep receiving a shared vault's mail after removal | One VEK per vault, grants only to invited accounts, per-vault authorization on the server, delivery keypair replaced on removal ([10](#10-vault-sharing)); known limitation: the VEK is not rotated on member removal ([13.1](#limitation-shared-member-removal)) |+| **Another AliasVault user**, including current and former shared-vault members | Holds their own account, grants they were given, and copies of data they synced | Open a vault they were not invited to; read another user's personal vault; keep receiving a shared vault's mail after removal | One VEK per vault, grants only to invited accounts, per-vault authorization on the server for vaults and their email ([10](#10-vault-sharing)) || **Holder of a stolen session token** | Calls the API as the user until the token expires or is revoked | Decrypt anything | Tokens never decrypt; access tokens live 10 minutes; refresh tokens are stored hashed and rotated on use; sessions can be revoked ([5.3](#53-session-tokens)) || **Holder of a copy of the encrypted data** (server database, device storage, backup, export file) | Unlimited offline computation | Decrypt without the master password or export password | Argon2id with a client-enforced minimum ([4](#4-key-derivation-and-key-hierarchy), [12](#12-vault-exports)); known limitation: the opt-in extension PIN can be guessed offline from a copy of the extension storage ([13.3](#limitation-pin-unlock)) || **Sender of a crafted email** | Sends any content to any alias | Run code in a client; read anything from the vault; learn anything about the recipient | Parser in the memory-safe Rust core; HTML sanitized and rendered in a sandboxed frame without scripts; attachments never opened automatically ([7](#7-email)) |@@ -262,7 +262,6 @@ AliasVault encrypts each incoming email in memory as soon as it arrives, with th- The public key is sent to the server together with the vault, signed with the publishing user's account signing key; the server only accepts a key signed by a member allowed to publish it2. Each alias is registered on the server as an *email claim*, which links the alias to the vault it belongs to- Moving an alias to another vault is signed with the user's account signing key, over the alias, both vaults and the current version of the claim; the server only accepts a move signed by the caller, so a stolen session token alone cannot send an alias's future email to another vault-3. When a member loses access to a shared vault, the Vault Delivery Keypair is replaced, so future emails are encrypted to a new key. Old keypairs are kept in the vault, so emails received before the change stay readable### 7.2. Email reception process1. When an email is received, the server:@@ -416,8 +415,7 @@ Access to a shared vault is called a *grant*: a copy of the vault's VEK encrypte4. **Revocation**- Removing a member from a shared vault, or leaving it, deletes their grant and their membership of the vault's group on the server. Deleting a shared vault deletes its group- - The server asks an admin's client to replace the Vault Delivery Keypair, so new emails are no longer encrypted to a key the removed member has seen- - The server no longer provides the shared vault to the removed member, so their access is blocked. The vault keeps its VEK, so the remaining members are not affected+ - The server no longer provides the shared vault or its email to the removed member, so their access is blocked. The vault keeps its VEK and Vault Delivery Keypair, so the remaining members are not affected### 10.2. Access and keys- **Group membership alone gives no access**: a group itself holds no keys. A user only gets access to a shared vault after being invited to it and accepting, which gives them their own grant.@@ -481,13 +479,21 @@ AliasVault also offers two unencrypted formats, to export your data and import i- **CSV**: your items as plain text, for use in other tools## 13. Known limitations-These are the known limitations of the current design relative to the [threat model](#2-threat-model), including trade-offs made on purpose. Each entry states what an attacker must already have for it to apply, what it allows, and what mitigates it today.--1. <Link id="limitation-shared-member-removal" />**Removing a member from a shared vault ends their access, but keeps the vault's key.** The server stops serving the vault to the removed member, their client deletes its copy, and new email is encrypted to a new delivery key. The VEK stays the same, so the other members are not affected. Only if the removed member later obtains the vault's ciphertext outside the API, from a leaked copy of the server database, could they decrypt it with the VEK they had, including email received after their removal. To fully separate a vault from a former member, create a new shared vault, move the items to it, invite the remaining members, delete the old vault, and change the passwords the former member had access to. The new vault has its own VEK and keypair.-2. <Link id="limitation-rollback" />**Clients do not detect an older vault revision being served as current.** This affects freshness, not confidentiality or authenticity: the server can only serve a revision that members of the vault wrote earlier or an empty vault, and cannot read, change or create vault contents ([2.4](#24-what-the-server-knows-and-can-do)). A client accepts such a revision as current, so changes made after it are lost and older states of items return. This is a deliberate trade-off: a server restored from a backup after a failure serves older revisions in the same way, and a client that refused them would lock its user out of their vault.-3. <Link id="limitation-pin-unlock" />**PIN unlock in the browser extension is an opt-in convenience.** PIN unlock is off by default and the master password is the default unlock method; the PIN setting notes that a PIN can be less secure than the master password. The Account Key is encrypted under a key derived from the PIN with Argon2id, and the 4-attempt limit applies to guesses made through the extension. An attacker who has copied the extension's storage, which requires forensic access or a compromised device ([2.5](#25-out-of-scope)), is not bound by that limit and can try PINs offline at the cost of one Argon2id derivation per guess, which is feasible for a 6-digit PIN; a longer PIN with letters and symbols takes more guesses. On mobile, the PIN-encrypted Account Key is also encrypted with a device-bound key from the iOS Keychain or the Android Keystore, so a copy of the app's storage alone is not enough to start guessing.-4. <Link id="limitation-post-quantum" />**Public-key encryption uses RSA-2048, not yet a post-quantum algorithm.** Grants, email keys and Login with Mobile use RSA-2048-OAEP. An attacker who keeps a copy of that ciphertext (from the server database or captured traffic) could decrypt it once a quantum computer able to break RSA-2048 exists, and with it the shared vault keys, emails and Account Keys it protects. RSA-2048 provides 112-bit security, which NIST SP 800-57 Part 1 approves through 2030; the NIST draft transition plan (IR 8547) sets 2035 for moving public-key encryption to post-quantum algorithms. Vault contents and the keys that protect the personal vault at rest use AES-256-GCM, which is considered safe against quantum computers. Every RSA ciphertext carries an algorithm identifier, so a post-quantum scheme can be added next to RSA without breaking existing data; it will be added once well-reviewed implementations exist on every platform AliasVault supports.-5. <Link id="limitation-argon2-parameters" />**A new device accepts any Argon2id settings at or above the OWASP recommended minimum.** Accounts use 64 MiB and 5 iterations, but a device that has never logged in before does not know that, so it accepts any settings down to the OWASP minimum of 19 MiB and 2 iterations ([section 4](#4-key-derivation-and-key-hierarchy)). A malicious server could send that minimum to a new device and obtain one login proof to guess the master password against at the lower cost. That minimum is still the current OWASP recommendation, a device that logged in before refuses weaker settings than it used, and a leaked database only allows guessing at the account's own settings. The minimum is set to the OWASP minimum because that was the default for accounts until version 0.31.0. Once all accounts have migrated to the current defaults, the minimum will be raised to match them.+These are the known limitations of the current design relative to the [threat model](#2-threat-model), including trade-offs made on purpose. Each applies only to an attacker who already has what the table lists.++| | Limitation | Requires | Effect | Status |+|---|---|---|---|---|+| [13.1](#limitation-shared-member-removal) | Revocation from a shared vault is not cryptographic | Former membership of the vault and its newer ciphertext obtained outside the API | Read what was added to that vault after the removal | By design |+| [13.2](#limitation-rollback) | Vault freshness is not verified | Control of the server | Serve an older vault revision; no reading or changing of contents | By design |+| [13.3](#limitation-pin-unlock) | PIN unlock in the browser extension | A copy of the extension's storage, for a user who turned PIN unlock on | Guess the PIN offline | Opt-in, off by default |+| [13.4](#limitation-post-quantum) | RSA-2048 for public-key encryption | Stored ciphertext and a quantum computer able to break RSA-2048 | Decrypt shared vault keys, emails and Login with Mobile transfers | Post-quantum scheme planned |+| [13.5](#limitation-argon2-parameters) | Argon2id floor on a new device | Control of the server while the user logs in on a new device | Guess the master password offline at the OWASP minimum cost | Floor raised after migration |++1. <Link id="limitation-shared-member-removal" />**Revocation from a shared vault is not cryptographic.** The server stops serving the vault and its email to a removed member, and their client deletes its local copy. The VEK and Vault Delivery Keypair stay the same, so the remaining members are not affected. Reading content added after the removal requires both the keys the former member kept and ciphertext the server no longer serves them, such as from a leaked copy of the server database. The remediation is to change the passwords in the shared vault where needed: the former member synced those items before the removal, and no change of keys can take that back. To also keep anything added later out of reach of the former member, create a new shared vault, move the items and aliases to it, invite the remaining members and delete the old vault, which deletes its data from the server, including its emails.+2. <Link id="limitation-rollback" />**Clients verify that a vault revision is authentic, not that it is the latest.** The server can serve a revision that members of the vault wrote earlier, or an empty vault, as the current one; it cannot read, change or create vault contents ([2.4](#24-what-the-server-knows-and-can-do)). A client accepts such a revision, so changes made after it are lost and older states of items return. Clients accept older revisions on purpose: a server restored from a backup serves them in the same way, and refusing them would lock users out of their vaults.+3. <Link id="limitation-pin-unlock" />**PIN unlock in the browser extension is an opt-in convenience.** PIN unlock is off by default and the master password is the default unlock method; the PIN setting notes that a PIN can be less secure than the master password. The Account Key is encrypted under a key derived from the PIN with Argon2id, and the extension allows 4 attempts. An attacker with a copy of the extension's storage, which requires forensic access or a compromised device ([2.5](#25-out-of-scope)), is not bound by that limit and can try PINs offline at the cost of one Argon2id derivation per guess, which is feasible for a 6-digit PIN; a longer PIN with letters and symbols takes more guesses. On mobile, the PIN-encrypted Account Key is also encrypted with a device-bound key from the iOS Keychain or the Android Keystore, so a copy of the app's storage alone is not enough to start guessing.+4. <Link id="limitation-post-quantum" />**Public-key encryption uses RSA-2048; a post-quantum algorithm is planned.** Grants, email keys and Login with Mobile use RSA-2048-OAEP. An attacker who keeps a copy of that ciphertext (from the server database or captured traffic) could decrypt it once a quantum computer able to break RSA-2048 exists, and with it the shared vault keys, emails and Account Keys it protects. RSA-2048 provides 112-bit security, which NIST SP 800-57 Part 1 approves through 2030; the NIST draft transition plan (IR 8547) sets 2035 for moving public-key encryption to post-quantum algorithms. Vault contents and the keys that protect the personal vault at rest use AES-256-GCM, which is considered safe against quantum computers. Every RSA ciphertext carries an algorithm identifier, so a post-quantum scheme can be added next to RSA without breaking existing data; it will be added once well-reviewed implementations exist on every platform AliasVault supports.+5. <Link id="limitation-argon2-parameters" />**A new device accepts Argon2id settings down to the OWASP minimum.** Accounts use 64 MiB and 5 iterations, but a device that has never logged in before does not know that, so it accepts any settings down to the OWASP minimum of 19 MiB and 2 iterations ([section 4](#4-key-derivation-and-key-hierarchy)). A malicious server could send that minimum to a new device and obtain one login proof to guess the master password against at the lower cost. A device that logged in before refuses weaker settings than it used, and a leaked database only allows guessing at the account's own settings. The minimum matches the default for accounts until version 0.31.0; once all accounts have migrated to the current defaults, it will be raised to match them.## 14. Security assurance and disclosure