You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PREWAVE-BE-097 — Replace Predictable Unsubscribe Values with Single-Use Signed Tokens #798
EmailChannel.generateUnsubscribeToken() currently returns ${userId}-${Date.now()}. This is predictable, embeds the user identifier, and has no demonstrated expiry, integrity protection, or replay policy.
Technical scope
Implement cryptographically secure, opaque unsubscribe tokens with bounded expiry, purpose binding, single-use/replay protection, and server-side verification or an equivalently reviewed authenticated-token design. Do not expose user IDs or other account identifiers in the token. Ensure unsubscribe actions only affect the intended channel and user, and are idempotent.
Required tests
Entropy and token unpredictability tests.
Expiry, tampering, cross-user substitution, replay, and duplicate unsubscribe cases.
Token redaction in logs and telemetry.
Email unsubscribe URL parsing and safe failure behavior.
Security and architecture constraints
Contracts and finalized canonical events remain authoritative for protocol state.
The API remains a projection/read and notification-delivery layer; it must not invent protocol outcomes.
Fail closed on missing, stale, ambiguous, unauthorized, or incomplete state.
Do not expose secrets, device tokens, email verification tokens, private evidence, or unnecessary personal data.
Activity