Skip to content

[PM-40646] Fix watch crash on corrupt encrypted data - #2896

Open
potatosips wants to merge 1 commit into
bitwarden:mainfrom
potatosips:fix/watch-corrupt-encrypted-data-crash
Open

[PM-40646] Fix watch crash on corrupt encrypted data#2896
potatosips wants to merge 1 commit into
bitwarden:mainfrom
potatosips:fix/watch-corrupt-encrypted-data-crash

Conversation

@potatosips

@potatosips potatosips commented Jul 20, 2026

Copy link
Copy Markdown

🎟️ Tracking

Fixes #2895

📔 Objective

Prevent the Bitwarden Watch app from terminating when locally persisted AES-GCM-encrypted Core Data data is malformed or can no longer be decrypted, for example after corruption or a key mismatch.

CryptoService now catches AES-GCM sealing and opening failures, logs them, and returns nil, allowing the Core Data transformer to treat unavailable data safely.

🧪 Validation

  • git diff --check
  • Source check confirms CryptoService no longer contains try! AES-GCM operations or plainData! unwraps.
  • watchOS runtime testing is pending because this audit was performed on Windows without Xcode/watchOS tooling.

🔒 Security impact

No confidentiality or integrity bypass was demonstrated; this is an availability and robustness fix.

@potatosips
potatosips requested review from a team and matt-livefront as code owners July 20, 2026 18:18
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Codex Audit seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@bitwarden-bot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We've added this to our internal tracking system for review.
ID: PM-40646
Link: https://bitwarden.atlassian.net/browse/PM-40646

Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process.

@bitwarden-bot bitwarden-bot changed the title Fix watch crash on corrupt encrypted data [PM-40646] Fix watch crash on corrupt encrypted data Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PM-40644] iOS Watch app crashes when encrypted Core Data data is invalid

3 participants