vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit 7f11363725f48868eafc1c81a92e89f31da08659
parent 8feed2916fee7a06e82e6df5070a9c4ee042bcd0
Author: BlackDex <black.dex@gmail.com>
Date:   Fri,  2 Dec 2022 16:25:11 +0100

Limit Cipher Note encrypted string size

As discussed in #2937, this will limit the amount of encrypted
characters to 10.000 characters, same as Bitwarden.
This will not break current ciphers which exceed this limit, but it will prevent those
ciphers from being updated.

Fixes #2937

Diffstat:
Msrc/api/core/ciphers.rs | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/api/core/ciphers.rs b/src/api/core/ciphers.rs @@ -366,6 +366,12 @@ pub async fn update_cipher_from_data( err!("Organization mismatch. Please resync the client before updating the cipher") } + if let Some(note) = &data.Notes { + if note.len() > 10_000 { + err!("The field Notes exceeds the maximum encrypted value length of 10000 characters.") + } + } + // Check if this cipher is being transferred from a personal to an organization vault let transfer_cipher = cipher.organization_uuid.is_none() && data.OrganizationId.is_some();