-
Notifications
You must be signed in to change notification settings - Fork 615
[BUG]: SSE and /mcp list paths ignore visibility filters #1915
Copy link
Copy link
Labels
bugSomething isn't workingSomething isn't workingpythonPython / backend development (FastAPI)Python / backend development (FastAPI)securityImproves securityImproves security
Milestone
Description
🐞 Bug Summary
Public access tokens created in the “All Teams” namespace are able to access team-scoped and private MCP servers and tools, despite the UI explicitly stating that such tokens should be restricted to public-only resources.
This results in unintended privilege escalation and represents a high-priority security issue.
🧩 Affected Component
-
mcpgateway- API -
mcpgateway- UI (admin panel) -
mcpgateway.wrapper- stdio wrapper - Federation or Transports
- CLI, Makefiles, or shell scripts
- Container setup (Docker/Podman/Compose)
- Other (explain below)
🔁 Steps to Reproduce
- In the admin UI, navigate to 🎫 API Tokens.
- Select the “All Teams” namespace.
- Create a new Public Access Token.
- UI description states the token should have public-only access.
- In 🖥️ MCP Servers, configure three MCP servers:
http://test-mcp-1.mcp.svc.cluster.local/mcp(public)http://test-mcp-2.mcp.svc.cluster.local/mcp(team)http://test-mcp-3.mcp.svc.cluster.local/mcp(private)- All servers use streamable HTTP mode.
- Verify that all tools/resources are discovered correctly.
- Open the Cloudflare MCP Playground: https://playground.ai.cloudflare.com/
- Connect to the mcp-context-forge gateway using:
- URL:
https://mcp.example.com/sse - Header:
Authorization: Bearer <public-token>
- URL:
- Observe the list of available tools and MCP servers.
🤔 Expected Behavior
The public access token should only expose tools and resources from:
- Public MCP servers (e.g.
test-mcp-1)
The token must not be able to see or invoke:
- Team-scoped MCP servers
- Private MCP servers
- Any non-public tools, resources, or prompts
❗ Actual Behavior
- The public access token can:
- See all tools from all MCP servers
- Successfully invoke tools from:
test-mcp-2(team)test-mcp-3(private)
- Access restrictions described in the UI are not enforced by the API.
This fully bypasses server visibility and access controls.
📓 Logs / Error Output
After manually deleting the token record from the database (since revoking the token via the admin UI leaves related DB records behind), the Cloudflare MCP Playground fails with an authorization error when attempting to reconnect.
🧠 Environment Info
| Key | Value |
|---|---|
| Version or commit | arm64-54e7a86c0ba066ac2d1e6c6d3c2124abbcd8518d |
| Runtime | Python |
| Platform / OS | Linux (Kubernetes) |
| Container | Docker on Kubernetes |
🧩 Additional Context
- Token revocation via the admin UI does not fully clean up token-related records in the database.
- Manual DB deletion is required to cleanup the DB after token invalidation.
- Given the scope of access bypass, this issue should be treated as high priority from a security standpoint.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpythonPython / backend development (FastAPI)Python / backend development (FastAPI)securityImproves securityImproves security