GHSA-wf8q-wvv8-p8jf
### Summary A critical identity spoofing vulnerability in MCPHub allows any unauthenticated user to impersonate any other user — including administrators — on SSE (Server-Sent Events) and MCP transport endpoints. The server accepts a username from the URL path parameter and creates an internal user session without any database validation, token verification, or authentication check. The source code itself acknowledges this gap with a TODO comment. ### Details MCPHub provides user-scoped SSE endpoints at the path `/:user/sse/:group`. The `sseUserContextMiddleware` in `src/middlewares/userContext.ts` (lines 42–75) extracts the username from `req.params.user` and constructs a fabricated `IUser` object directly, bypassing all authentication: ```typescript export const sseUserContextMiddleware = async ( req: Request, res: Response, next: NextFunction, ): Promise<void> => { const userContextService = UserContextService.getInstance(); const username = req.params.user; // ← Taken directly from URL, no validation whatsoever if (username) { // Note: In a real implementation, you should validate the user exists // and has proper permissions const user: IUser = { username, // ← Completely attacker-controlled password: '', isAdmin: false, // TODO: Should be retrieved from user database }; userContextService.setCurrentUser(user); // ← Fabricated identity is accepted as real attachCleanupHandlers(); console.log(`User context set for SSE/MCP endpoint: ${username}`); next(); } // ... }; ``` The SSE routes in `src/server.ts` (lines 132–161) apply only rate limiting and this context middleware — there is no authentication middleware in the chain: ```typescript // User-scoped routes with user context middleware this.app.get( `${this.basePath}/:user/sse/:group(.*)?`, mcpConnectionRateLimiter, // Only rate limiting sseUserContextMiddleware, // Identity from URL — no auth (req, res)
Properties
- ghsa_id
- GHSA-wf8q-wvv8-p8jf
- severity
- critical
- summary
- @samanhappy/mcphub: SSE Endpoint Accepts Arbitrary Username from URL Path Without Authentication, Enabling User Impersonation
- cvss_score
- 9.1
- cve_id
- GHSA-wf8q-wvv8-p8jf
- cvss_vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
- is_ghsa_only
- true
- ghsa_published
- 2026-05-14T20:44:22Z
- source_url
- https://github.com/advisories/GHSA-wf8q-wvv8-p8jf
- ghsa_updated
- 2026-05-14T20:44:26Z
Related Entities (4)
VULNERABLE_TO (1)
AFFECTS (1)
HAS_WEAKNESS (1)
REPORTED_BY (1)
Explore deeper with Ninja Signal's threat intelligence graph