Skip to content

Fix "Invalid folder" error when client sends empty folderId string#6967

Open
mango766 wants to merge 1 commit intodani-garcia:mainfrom
mango766:fix/empty-folder-id
Open

Fix "Invalid folder" error when client sends empty folderId string#6967
mango766 wants to merge 1 commit intodani-garcia:mainfrom
mango766:fix/empty-folder-id

Conversation

@mango766
Copy link

Newer Bitwarden client versions (browser extension v2026.2.0+) send folderId: "" instead of folderId: null when "No folder" is selected. This causes the folder validation at ciphers.rs:451 to 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 "" as Some(FolderId("")) rather than None, so the validation code tries to look up a folder with an empty UUID.

This PR normalizes empty folderId values to None at 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::filter to convert Some(FolderId(""))None before validation, and the normalized value is also passed to move_to_folder so the downstream logic is consistent.

Fixes #6962

Newer Bitwarden client versions (e.g. browser extension v2026.2.0) send
folderId as "" (empty string) instead of null when "No folder" is selected.
This causes the folder validation to attempt a database lookup with an
empty string, which fails with "Invalid folder" and prevents saving the
cipher.

Normalize empty folderId to None at all three validation points:
- update_cipher_from_data (create/update cipher)
- put_cipher_partial (update cipher details)
- move_cipher_selected (move ciphers to folder)

Fixes dani-garcia#6962
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't create new credentials in Folder "Kein Ordner" (No folder)

1 participant