Skip to content

fix: enforce session ownership in load_session and get_or_create_session#83

Merged
RichardAtCT merged 2 commits intomainfrom
claude/fix-session-ownership-95HAs
Feb 23, 2026
Merged

fix: enforce session ownership in load_session and get_or_create_session#83
RichardAtCT merged 2 commits intomainfrom
claude/fix-session-ownership-95HAs

Conversation

@RichardAtCT
Copy link
Copy Markdown
Owner

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

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
@RichardAtCT RichardAtCT merged commit 699878e into main Feb 23, 2026
1 check passed
@RichardAtCT RichardAtCT deleted the claude/fix-session-ownership-95HAs branch February 23, 2026 05:57
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants