Skip to content

fix: harden cryptographic session lifecycle and integrity validation#397

Open
Temi709 wants to merge 2 commits into
codebestia:mainfrom
Temi709:fix/crypto-session-persistence-integrity
Open

fix: harden cryptographic session lifecycle and integrity validation#397
Temi709 wants to merge 2 commits into
codebestia:mainfrom
Temi709:fix/crypto-session-persistence-integrity

Conversation

@Temi709

@Temi709 Temi709 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR strengthens the security and reliability of the messaging and file handling pipeline by addressing multiple cryptographic and integrity issues.

Changes

  • Corrected ECDH session establishment to derive shared secrets using the local private key and peer public key with the proper WebCrypto API usage.
  • Persisted device identity private CryptoKey objects in IndexedDB via structured cloning to maintain stable device identities across sessions and page reloads.
  • Unified push notification recipient filtering so both text and file message push paths consistently honor conversation mute status and device pushEnabled preferences.
  • Added SHA-256 integrity verification during file upload confirmation to detect corrupted or substituted uploads before marking files as ready.

Testing

  • Added/updated unit tests covering:
    • Two-party ECDH shared secret derivation.
    • Identity key persistence across simulated page reloads.
    • Consistent push recipient filtering across all push paths.
    • File integrity verification for matching and mismatched hashes.
  • Verified no regressions to encrypted messaging, push delivery behavior, or file upload workflows.

Closes #348
Closes #350
Closes #351
Closes #352

@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@Temi709 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant