dani-garcia / vaultwarden

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

fix issue with adding ciphers to organizations on native ios app #4800

Closed stefan0xC closed 2 months ago

stefan0xC commented 2 months ago

This should fix the issues reported in #4767 where an entry added via the native iOS app cannot be decrypted: Screenshot 2024-07-30 at 08-46-28 353277473-652ee101-fd1e-4a6d-af6a-510dd90f4994 mp4

The problem seems to be that the iOS app sends an organizationID which serde fails to deseralize and because it's an optional argument adding the cipher will not fail but it will be added incorrectly to your personal vault, unless you have disabled personal ownerships. So to prevent such corruptions from occurring again I've added a reverse sanity check, just in case some other clients send the organization_id in an unrecognizable format.

lapastillaroja commented 1 week ago

I'm still having this same issue even after upgrading to 1.32 version. On iOS 17 (latest version 2024.9.2(1106) ) and also web app. Apart from upgrading to 1.32 there's any other step to be done?

Screen shot from web console image

stefan0xC commented 1 week ago

@lapastillaroja you will have to either fix the offending item by adding the correct organization id manually in the database or remove it.

lapastillaroja commented 1 week ago

and advice on how to find the offending items?

stefan0xC commented 1 week ago

If you are the only user of your instance just delete the latest entry (via created_at column) otherwise you might want to restrict this to just your account (user_uuid) or restore the latest working version from any backups you might have made.

lapastillaroja commented 1 week ago

Thank you @stefan0xC , removing the latest added item from the ciphers table fixed the issue.