dani-garcia / vaultwarden

Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs
GNU Affero General Public License v3.0
39.26k stars 1.9k forks source link

Cipher update time is modified on folder change #884

Open jjlin opened 4 years ago

jjlin commented 4 years ago

When changing the folder that a cipher/entry belongs to, the cipher update time is modified, even if the actual contents of the entry were not modified. This is arguably acceptable behavior for an entry owned by a single user, but for an org-owned entry, it has some unintuitive consequences. That is, if someone you've shared the entry with decides to organize it into a folder on their side, that shouldn't be shown as an update to all other users the entry is shared with, because

BlackDex commented 3 years ago

This is something which also happens upstream if i'm correct. Also, if a cipher is not writeable by a user, they can't even put it in a folder at all using upstream, in my opinion that isn't good logic, so i think how bitwarden_rs has it is better.

jjlin commented 3 years ago

Yeah, that's correct. It stems from how per-cipher and per-user data is mixed together, which requires extra unmixing work to get the right behavior. Neither upstream nor bitwarden_rs are doing the unmixing currently, as I noted here:

https://github.com/dani-garcia/bitwarden_rs/blob/4628e4519de043aae343b4d0a1e2f110bd40aa8a/src/api/core/ciphers.rs#L499-L506

BlackDex commented 3 years ago

This also happens during key-rotation when changing the password and checking the Also rotate my account's encryption key. I think that should not be the case, since it will mess-up the users whole vault because every cipher is being saved again.

BlackDex commented 1 year ago

This is btw partially fixed when moving ciphers via the multiple-select flow. Doesn't matter if you tick one or multiple boxes. But for all the ciphers ticked, and then using the 3dot main menu and select Move selected, they will be moved, but without updating the cipher update time.