fix(auth): drop lets-chat session on Bunyip identity swap (LC-414) #429
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/lets-chat!429
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/LC-414-session-bunyip-sub-reconcile"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
inject_usernow reads the Bunyipaccess_tokencookie (shared eTLD+1 cookie domain) on every authed request. If itssubclaim disagrees with thebunyip_substamped on the user the lets-chat session resolves to, the browser has signed into Bunyip as a different user since the lets-chat session was minted. The middleware deletes the stale lets-chat session and skips user injection, so the next handler resolves an anonymous request and the existing redirect chain bounces through/auth/bunyip/startto re-auth. The check is best-effort: no Bunyip cookie present (dev, or a never-cookied browser), a malformed cookie, or a row that predates LC-22 (nobunyip_sub) all no-op so a real user is never logged out spuriously. Thesubis decoded base64-only without JWKS verification: this is an identity-drift detector, not an auth boundary (auth comes from the lets-chat session), and the worst attacker outcome from a forged Bunyip cookie is a forced logout of the legitimate user, not access.#LC-414