From ab088536bb845cc16849773a71ccb4e980784187 Mon Sep 17 00:00:00 2001 From: Nik Gilmore Date: Mon, 30 Mar 2026 15:23:17 -0700 Subject: [PATCH] [PM-33952] Fix cipher key encryption logic when editing ciphers (#19695) --- libs/common/src/vault/services/cipher.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/common/src/vault/services/cipher.service.ts b/libs/common/src/vault/services/cipher.service.ts index 595f73a0431..25c48c1d835 100644 --- a/libs/common/src/vault/services/cipher.service.ts +++ b/libs/common/src/vault/services/cipher.service.ts @@ -321,8 +321,8 @@ export class CipherService implements CipherServiceAbstraction { if ( // prevent unprivileged users from migrating to cipher key encryption - (model.viewPassword || originalCipher?.key) && - (await this.getCipherKeyEncryptionEnabled()) + (model.viewPassword && (await this.getCipherKeyEncryptionEnabled())) || + originalCipher?.key ) { cipher.key = originalCipher?.key ?? null; const userOrOrgKey = await this.getKeyForCipherKeyDecryption(cipher, userId);