Skip to content

Conversation

@laukkw
Copy link

@laukkw laukkw commented Dec 21, 2025

Description

Enforce AAD semantics for transport‑encrypted payloads, bind decrypted data to the authenticated user, and add crypto unit tests.
The change fixes a security/consistency gap where AAD was parsed but never validated. Now transport‑encrypted payloads are bound to the authenticated user and purpose, with timestamp
checks enforced, so mismatched or replayed data is rejected instead of silently accepted.

  • [ ✔] Security fix

    Related Issues

    • Closes #
    • Related to #

Changes Made

  • Validate AAD JSON and timestamps during decryption.
  • Verify AAD userId/purpose against JWT user context in encrypted config endpoints.
  • Align frontend userId source with stored auth_user for consistent AAD.
  • Add crypto unit tests for valid/missing/mismatched/invalid AAD.

Testing

  • [✔] Tested locally
  • [✔] Tests pass
  • [ ✔] Verified no existing functionality broke

Checklist

Code Quality

  • [✔] Code follows project style
  • [✔] Self-review completed

Additional Notes

Transport‑encrypted endpoints now require AAD userId to match the authenticated user; older sessions missing auth_user may need re‑login. The /api/crypto/decrypt debug endpoint
still bypasses AAD semantic checks.

By submitting this PR, I confirm :

  • [ ✔] I have read the Contributing Guidelines (../CONTRIBUTING.md)
  • [ ✔] I agree to the Code of Conduct (../CODE_OF_CONDUCT.md)
  • [ ✔] My contribution is licensed under AGPL-3.0

@cla-assistant
Copy link

cla-assistant bot commented Dec 21, 2025

CLA assistant check
All committers have signed the CLA.

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