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

Closed
opened 2026-04-06 01:34:09 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @stefan0xC on 7/30/2024

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.

*Originally created by @stefan0xC on 7/30/2024* 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](https://github.com/user-attachments/assets/73be06a8-ca61-4a8c-9355-7ab210c4286e) The problem seems to be that the iOS app sends an [organizationID](https://github.com/bitwarden/ios/blob/3ec242eb73735608fbed32837303b22ceb531abb/BitwardenShared/Core/Vault/Models/Request/CipherRequestModel.swift#L47) 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.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#1024