Skip to content

Validate user on Streamable HTTP session DELETE#1604

Open
halter73 wants to merge 2 commits into
mainfrom
halter73/validate-user-on-session-delete
Open

Validate user on Streamable HTTP session DELETE#1604
halter73 wants to merge 2 commits into
mainfrom
halter73/validate-user-on-session-delete

Conversation

@halter73
Copy link
Copy Markdown
Contributor

HandleDeleteRequestAsync currently tears down a session for anyone who sends DELETE with the right Mcp-Session-Id. GET and POST already verify the authenticated user matches the user who initiated the session via HasSameUserId, so DELETE was the odd one out.

Mirror the same check on DELETE so a session ID alone isn't enough to kill someone else's session — defense-in-depth against a stolen/leaked session ID being used to DoS the original owner.

Added a focused test that:

  • DELETEs as a different user → 403 Forbidden
  • The original user's POST still works
  • The original user can still DELETE their own session

Second commit is unrelated cleanup: SHA-pinning the danielpalme/ReportGenerator-GitHub-Action reference in ci-code-coverage.yml to match how every other third-party action in the repo is pinned.

halter73 and others added 2 commits May 27, 2026 08:59
GET and POST already verify that the authenticated user matches the user who initiated the session via HasSameUserId. DELETE skipped that check, so anyone holding a session ID could tear down someone else's session. Mirror the same check on DELETE as a defense-in-depth DoS mitigation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Matches how the other third-party actions in this repo are pinned, so a compromised upstream tag pointer can't redirect coverage runs to a different commit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.

1 participant