[PM-40277] Key rotation corrupts attachments, fido2 credentials - #1265
[PM-40277] Key rotation corrupts attachments, fido2 credentials#1265mzieniukbw wants to merge 6 commits into
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed a focused bugfix for key rotation corrupting attachment keys and FIDO2 credentials on keyless legacy ciphers. The fix introduces Code Review DetailsNo blocking findings. Notes from analysis (no action required):
|
🔍 SDK Breaking Change DetectionSDK Version:
Breaking change detection uses the build of the SDK from this branch, including any incompatibities pre-existing on or merged into this branch. Check the workflow logs to confirm. |
…-attachments-fido2-credentials
quexten
left a comment
There was a problem hiding this comment.
In my opinion, we should re-structure the vault item encryption. It still feels very error-prone and brittle, but that shouldn't be part of this work.
…-attachments-fido2-credentials
…-attachments-fido2-credentials
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1265 +/- ##
==========================================
+ Coverage 85.86% 85.90% +0.04%
==========================================
Files 493 493
Lines 70931 71145 +214
==========================================
+ Hits 60906 61120 +214
Misses 10025 10025 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…s-fido2-credentials
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-40277
📔 Objective
SDK key rotation will currently corrupt fido2 credentials, attachments. This is because the cipherview has encrypted fields on it, namely fido2 credentials, attachment keys, which just get passed through.
Adds
CipherView::generate_cipher_key_from, which takes the source key id explicitly (generate_cipher_keynow delegates to it withUserkey id slot), and has the keyless cipher rotation path pass the real current key so the FIDO2 credentials and attachments are re-wrapped correctly.Included test coverage that covers all cipher key rotation with fido2 and attachments possibilities.
🚨 Breaking Changes
None expected.
Android breaking change failure is unrelated to this PR.