fix(e2ee): try expired subkeys when decrypting historical messages#426
Merged
Conversation
eslint-plugin-react-hooks@7.1.1 hard-imports `zod-validation-error/v4`, a subpath that only exists in zod-validation-error v4. The root package.json already pins `zod-validation-error: 4.0.2` via overrides (added during the React 19 migration, e3dfe4c), but the lockfile was never regenerated — so 3.5.4 stayed resolved, and 3.5.4 only exports `.`, making `npm run lint` crash with ERR_PACKAGE_PATH_NOT_EXPORTED in the @xmpp/fluux workspace. Pin only the zod-validation-error lockfile entry to 4.0.2 (its peer `zod: ^3.25.0 || ^4.0.0` is satisfied by the project's zod 3.25.76). No other dependency resolutions change.
The DecryptionHelper only tried encryption subkeys that pass the current-time policy filter. After a subkey rotation the retired subkey is expired, so Sequoia skipped it — making MAM-replayed messages encrypted to the old subkey permanently undecryptable. Add a second pass that iterates over ALL secret subkeys regardless of policy/expiry. The first pass (policy-filtered) still runs for the common case; the fallback only fires when no current subkey matched. The existing test `ciphertext_encrypted_to_old_subkey_still_decrypts_after_rotation` did not catch this because it ran within the 1-second validity window. A new test sleeps past that window to exercise the fallback path.
f348129 to
5d8af90
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DecryptionHelperonly tried encryption subkeys passing the current-time policy filter. After a subkey rotation, the retired subkey is expired and Sequoia skipped it — making MAM-replayed messages encrypted to the old subkey permanently undecryptable.ciphertext_encrypted_to_old_subkey_still_decrypts_after_rotationdid not catch this because it ran within the 1-second validity window of the expired binding. A new test sleeps past that window to exercise the fallback path.