Files
mcphub/src
copilot-swe-agent[bot] 500eec3979 Fix authentication bypass vulnerabilities in MCP/SSE endpoints
- Fix validateBearerAuth to use loadOriginalSettings() instead of loadSettings()
  to prevent bearer auth bypass when no user context exists
- Add authentication validation to sseUserContextMiddleware for user-scoped routes
  to prevent user impersonation via URL path parameters
- Require valid OAuth/bearer token for accessing /:user/mcp and /:user/sse endpoints
- Return 401 Unauthorized for user-scoped routes without authentication
- Return 403 Forbidden when authenticated user doesn't match requested username

Security improvements:
1. Bearer auth now correctly reads enableBearerAuth from system config
2. User-scoped endpoints now require authentication
3. Users can only access their own resources
4. Prevents impersonation attacks via URL manipulation

Co-authored-by: samanhappy <2755122+samanhappy@users.noreply.github.com>
2025-11-23 06:30:52 +00:00
..
2025-05-25 21:09:47 +08:00