mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-22 11:45:52 +00:00
1118e09fcd
clearSession invalidated the session-store record and zeroed both session/CSRF cookies on the client side, but never deleted the matching entry from the CSRF store. The orphaned record stuck around for up to 4 hours (CSRF TTL) after every logout. Not exploitable — the session itself was gone, so the stale CSRF entry could not be used — but the asymmetry was real: InvalidateUserSessions (password change) and InvalidateOldSessionFromRequest (re-login) both already called DeleteCSRFToken, and logout was the missing path. Add the same call in clearSession alongside InvalidateSession. Regression test TestClearSession_DeletesServerSideCSRFToken sets up a real session + CSRF token pair, calls clearSession with a request carrying the session cookie, and asserts the CSRF token no longer validates against the session ID afterward.