fix(admin): remove raw viewer session token exposure#18
Open
joelev wants to merge 1 commit intosdamico:mainfrom
Open
fix(admin): remove raw viewer session token exposure#18joelev wants to merge 1 commit intosdamico:mainfrom
joelev wants to merge 1 commit intosdamico:mainfrom
Conversation
Contributor
Author
|
Reviewer checklist:\n\n1. Confirm no longer returns raw values.\n2. Confirm lookup is by surrogate ID (), not bearer token ID.\n3. Confirm detail response never includes raw bearer session ID.\n4. Confirm event lookup still resolves correctly server-side from internal raw session ID. |
Contributor
Author
|
Reviewer checklist:
|
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
Remove raw viewer bearer-token exposure from admin session analytics APIs by switching to a non-secret surrogate ID.
Beads
Problem
Admin session APIs were returning raw
sessions.idvalues. Those IDs are the livesite-authbearer tokens, so exposure in analytics endpoints enables session hijacking by any authenticated admin.Root Cause
Admin list/detail endpoints used
sessions.iddirectly in both response payloads and detail lookup.Changes
api/admin/sessions.jsidfield withmd5(s.id) AS id.api/admin/session.jsidquery param is now validated as a 32-char hex surrogate.WHERE md5(id) = $id.id(never raw bearer token).Validation
idand response does not leak raw tokenid, uses internal raw id only for event query, and response does not leak raw tokennpm run buildpasses:Built content/page.html (63624 bytes, 9 slides)Risk
/api/admin/sessionmust now pass surrogate IDs from/api/admin/sessions, not raw bearer IDs.Rollback
23db8ee.