fix: enforce session ownership in load_session and get_or_create_session#83
Merged
RichardAtCT merged 2 commits intomainfrom Feb 23, 2026
Merged
Conversation
load_session() previously queried by session_id alone with no user_id filter, and get_or_create_session() never verified that a loaded session's user_id matched the requesting user. This violated defense-in-depth: a leaked session ID could allow any authenticated user to resume another user's Claude conversation. Changes: - Add required user_id parameter to SessionStorage.load_session() - SQLiteSessionStorage filters by both session_id AND user_id in SQL - InMemorySessionStorage checks ownership and logs mismatches - SessionManager.get_or_create_session() validates ownership in both the active_sessions cache and storage lookups - SessionManager.get_session_info() scoped to requesting user - ClaudeIntegration facade updated to pass user_id through https://claude.ai/code/session_019XA6WWNjCskbnqxYx13o2e
3 tasks
altdev0x
pushed a commit
to altdev0x/claude-code-telegram
that referenced
this pull request
Feb 23, 2026
…d bash checks; add skills to internal subdirs Upstream PRs merged: RichardAtCT#62 (replace ToolMonitor with can_use_tool), RichardAtCT#94 (session resume fallback), RichardAtCT#69 (bash chained command boundary), RichardAtCT#66 (handler robustness), RichardAtCT#83 (session ownership enforcement). Local change: add "skills" to _CLAUDE_INTERNAL_SUBDIRS so Claude Code can access symlinked skills under ~/.claude/skills/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
load_session() previously queried by session_id alone with no user_id
filter, and get_or_create_session() never verified that a loaded
session's user_id matched the requesting user. This violated
defense-in-depth: a leaked session ID could allow any authenticated
user to resume another user's Claude conversation.
Changes:
the active_sessions cache and storage lookups
https://claude.ai/code/session_019XA6WWNjCskbnqxYx13o2e