Skip to content

fix(api): isolate MCP server registry by session user - #51

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-mcp-owner-isolation-4ba6
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-mcp-owner-isolation-4ba6

Conversation

@cursor

@cursor cursor Bot commented Aug 20, 2026

Copy link
Copy Markdown

Authenticated /api/mcp/* routes still used a process-global mcpClient. Any signed-in user could list, read (including metadata / environment), delete, or invoke tools against another user's MCP registration.

Trigger

User A POST /api/mcp/servers with {name,url,environment}. User B in the same Node process GET /api/mcp/servers sees A's server and env. B can DELETE by id or POST /api/mcp/tools/call against A's tools.

Distinct from #49 (connector store) and #47 (agents/[id] auth only).

Fix

Tests

pnpm exec vitest run tests/api/mcp-servers-route.test.ts plus full pnpm test:run (242 tests).

Not in this PR

  • AgentStore still process-global (/api/agents)
  • /api/setup/test-connection still accepts attacker-controlled Supabase URL (SSRF)
Open in Web View Automation 

Process-global mcpClient returned every user's servers (including
environment metadata) to any authenticated caller. Scope list/get/delete
and tool calls to session.user.id and ignore client-supplied ownerUserId.

Co-authored-by: esadrianno <esadrianno@gmail.com>
@vercel

vercel Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v0-agent-kit Ready Ready Preview, v0 Aug 20, 2026 11:22am

This branch was successfully deployed

1 active deployment
Preview — 8208c614 Deployed Aug 20, 2026 by vercel[bot]
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