mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-07-17 17:32:27 -05:00
[PR #6967] [CLOSED] Fix "Invalid folder" error when client sends empty folderId string #32897
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/6967
Author: @mango766
Created: 3/18/2026
Status: ❌ Closed
Base:
main← Head:fix/empty-folder-id📝 Commits (1)
8869652Fix "Invalid folder" error when client sends empty folderId string📊 Changes
1 file changed (+14 additions, -6 deletions)
View changed files
📝
src/api/core/ciphers.rs(+14 -6)📄 Description
Newer Bitwarden client versions (browser extension v2026.2.0+) send
folderId: ""instead offolderId: nullwhen "No folder" is selected. This causes the folder validation atciphers.rs:451to attempt a database lookup with an empty string, which naturally fails and returns "Invalid folder" — preventing users from saving credentials entirely.As identified by @stefan0xC in the issue thread, this is because the
Option<FolderId>deserialization treats""asSome(FolderId(""))rather thanNone, so the validation code tries to look up a folder with an empty UUID.This PR normalizes empty
folderIdvalues toNoneat all three places where folder validation occurs:update_cipher_from_data(create/update cipher)put_cipher_partial(update cipher details)move_cipher_selected(move ciphers to folder)The normalization uses
Option::filterto convertSome(FolderId(""))→Nonebefore validation, and the normalized value is also passed tomove_to_folderso the downstream logic is consistent.Fixes #6962
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.