Skip to content

fix(encrypted_sled): bind AEAD AAD to store key - #341

Open
SashaMIT wants to merge 1 commit into
axelarnetwork:mainfrom
SashaMIT:fix/encrypted-sled-aad-bind-key
Open

fix(encrypted_sled): bind AEAD AAD to store key#341
SashaMIT wants to merge 1 commit into
axelarnetwork:mainfrom
SashaMIT:fix/encrypted-sled-aad-bind-key

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • encrypted_sled previously called XChaCha20Poly1305 with empty AAD (b\"\"), so ciphertext+nonce records were not bound to their sled key / uid.
  • New writes use the store key as AAD.
  • Decrypt tries key AAD first, then falls back to empty AAD for legacy records (no forced migration).

Impact

Local DB / backup tamper class: under the same password, records could be swapped across keys without AEAD failure. Not claimed as remote unauth.

Test plan

  • encrypt_with_nonce_known_vector (goldie updated)
  • ciphertext_bound_to_key_aad
  • CI full suite

Elacity CodeRED Amber review (portal #33).

Encrypt share/value records with the sled key as associated data so
ciphertext+nonce blobs cannot be moved across keys under the same
password. Decrypt tries key AAD first and falls back to empty AAD for
records written before this change.

Co-authored-by: Cursor <cursoragent@cursor.com>
@SashaMIT
SashaMIT requested a review from a team as a code owner August 4, 2026 12:22
@SashaMIT

SashaMIT commented Aug 5, 2026

Copy link
Copy Markdown
Author

Friendly bump — binds AEAD AAD to the store key for encrypted share records (legacy decrypt fallback included). Happy to iterate on the fallback window if you prefer a hard cutover.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant