[PR #6967] [CLOSED] Fix "Invalid folder" error when client sends empty folderId string #27438

Closed
opened 2026-06-15 14:44:29 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/6967
Author: @mango766
Created: 3/18/2026
Status: Closed

Base: mainHead: fix/empty-folder-id


📝 Commits (1)

  • 8869652 Fix "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 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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/6967 **Author:** [@mango766](https://github.com/mango766) **Created:** 3/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/empty-folder-id` --- ### 📝 Commits (1) - [`8869652`](https://github.com/dani-garcia/vaultwarden/commit/8869652dad7ec551fa8a168f2d95cded0958994b) Fix "Invalid folder" error when client sends empty folderId string ### 📊 Changes **1 file changed** (+14 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/api/core/ciphers.rs` (+14 -6) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-06-15 14:44:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#27438