Repository navigation
fix(server): bind MCP transport sessions to authenticated owners - #30591
mahruskazi wants to merge 1 commit into
Conversation
Prepared as a draft for maintainer review.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Problem
MCP transport sessions are not bound to the authenticated namespace that initialized them. A different valid credential that knows a session ID can delete that transport and interrupt its owner.
Change
Bind each transport session to its initializing authenticated namespace. Reject foreign POST, GET, and DELETE requests with 404 before dispatch. Authenticate every new request so expired or revoked credentials cannot reuse an existing transport.
No session-count quota is introduced. Requests and streams accepted before a later revocation are not cancelled; ownership records for sessions never deleted remain until server restart, matching the transport state lifetime.
Scope and approval
This draft addresses transport-session ownership only. No prior maintainer approval is claimed; maintainer review and triage remain pending.
Verification
Recorded HTTP checks reproduce foreign-session DELETE against the base, then cover foreign POST/GET/DELETE denial, OAuth namespaces, owner DELETE, expiry, trusted refresh, revocation, and more than 64 reconnects on one credential. The prepared candidate passed
vp run check:changedwith 31 tests across 3 files. This publication preserves the tested tree. Repo-wide CI and live client reinitialization after a 404 have not been checked. Final independent review is pending.Models: GPT-6.1 Sol and Claude Opus 5.5. Harnesses: Codex and Claude Code in T3 Code.