fix(security): SUM-SEC-01 — reject deactivated users at session resolve - #87
Merged
Merged
Conversation
Session resolution now JOINs core.user and requires active=true; inactive or expired sessions are deleted and the cookie is cleared on the next request. Also revokes all sessions on password change, shortens session TTL, ends browser sessions on last tab close, and consolidates auth code.
Session resolution JOINs core.user and requires active=true; inactive or expired sessions are deleted and the cookie is cleared. Includes integration tests and removes SUM-SEC-02 scope from this branch.
CHINMAYVIVEK
approved these changes
Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resolveSessionJOINssys.sessionwithcore.userand requiresactive = true; on failure deletes the session row, clearssumeru_session, and returns uid 0SetUserPasswordHashcallsDestroySessionsForUserto revoke all DB sessions on password changesendBeaconlogoutauth.go+login.go; removeauth_session.goTest plan
go test ./test/core/server/web/... -count=1SUMERU_TEST_DSN='...' go test -tags integration ./test/core/server/web/... -run 'TestInactive|TestPassword|TestResolve' -vcore.user.active = false→ next/webrequest redirects to login;/api/rpcreturns 401; cookie clearedsys.sessionrows for that user