Repository navigation
fix(security): keep the login password out of the shared session map (#2341) - #2389
Merged
Merged
Conversation
…2341) SessionService cached every user's plaintext login password as a String in a singleton map for the life of the JVM and returned it from getAllSessionObjects() to ~20 callers; a later login by the same principal never refreshed it. The credential is now a char[] in a separate map, readable only through ISessionService.passthroughCredential() (its single consumer is the pass-through connection path), replaced on re-login, zeroed on logout and when the HTTP session ends (new HttpSessionListener). saiku.passthrough.retainCredential=false stops retaining it for deployments without pass-through datasources. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Semantic model diffSemantic model diffNo model changes and no broken references. saiku#1434 · reproduce locally with |
This was referenced Nov 18, 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
The plaintext login password is no longer stored in
SessionService.sessionHolderor returned bygetAllSessionObjects(); it is kept (only for pass-through datasources) as a wipeablechar[]behind a dedicated accessor.Root cause
createSessionput the submitted password in the per-principal session map (aString, inserted only if the principal was absent), the map lived on a singleton for the JVM's life (onlylogout()/clearSessions()removed it, not HTTP-session expiry), andgetAllSessionObjects()returned it to ~20 callers that only read username/roles. A rotated password was never refreshed.What consumed it
Only
SecurityAwareConnectionManager.handlePassThrough()(datasources withsecurity.type=passthrough). Every other caller reads username/roles.Fix
ConcurrentHashMap<principal, char[]>;getSession(),getAllSessionObjects()andlogin()'s return value strip anypasswordkey.ISessionService.passthroughCredential()(defaultnull);handlePassThroughreads only that.clearSessions, and zeroed when the HTTP session ends via a newSessionSecretCleanupListenerregistered inweb.xml(SessionService.httpSessionDestroyed).-Dsaiku.passthrough.retainCredential=falsestops retaining it altogether. Documented indocs/operator-hardening.md.Decision for the maintainer: the issue suggests caching only when a pass-through datasource exists. The datasource list is workspace- and role-scoped and cannot be read reliably at login, and guessing wrong would silently break pass-through, so the default keeps the credential (now contained and wiped) and the property opts out. Say if you want the default flipped, or an auto-detect wired in.
Overlap: #2338, #2339 and #2345 are separate PRs on the same login/session code, each based on development.
Test plan
acceptance/2341/spec.json(command spec,node check.mjs, a source-level contract check because the cache has no HTTP surface) as the first commit; verified red on the base tree locallymvn -pl saiku-core/saiku-web -am test -Dtest='SessionService*Test,SecurityAwareConnectionManager*Test,SessionResourceTest'green, including newSessionServicePassthroughSecretTest(no retention when disabled, accessor-only, logout wipe, re-login replaces, session-destroy wipe) and an updated pass-through testspotless:checkon saiku-web and saiku-serviceCloses #2341
🤖 Generated with Claude Code