Junglewise Threat Intelligence

samanhappy MCPHub authentication bypass via user impersonation in SSE endpoint

Severity: critical · CVSS 9.1 · Published 2026-05-14

Technologies: Samanhappy Mcphub, @samanhappy/mcphub (npm). Vendors: Samanhappy, npm.

Executive brief

A critical security flaw in MCPHub allows anyone on the network to impersonate any user, including administrators. MCPHub is a tool used for managing Model Context Protocol (MCP) connections. By exploiting this vulnerability, an attacker can execute commands and access data as if they were a legitimate user, potentially leading to unauthorized data access or full system compromise.

Technical details

A vulnerability in the `sseUserContextMiddleware` of MCPHub allows for authentication bypass by spoofing (CWE-290). The middleware extracts a username directly from the `:user` URL path parameter and constructs a user session object without performing database validation or token verification. An attacker can establish a Server-Sent Events (SSE) connection as any user, including administrators, and subsequently execute MCP tool calls under that identity. Additionally, the use of a singleton for `UserContextService` introduces a race condition (CWE-362) where concurrent connections can overwrite user contexts. The issue is fixed in version 0.12.15.

Affected products

  • samanhappy @samanhappy/mcphub < 0.12.15

Timeline

  • 2026-05-09: disclosed
  • 2026-05-09: patched: Version 0.12.15 released
  • 2026-05-14: advisory

References

Related threats