Miggo Logo

CVE-2025-58444: MCP Inspector is Vulnerable to Potential Command Execution via XSS When Connecting to an Untrusted MCP Server

N/A

CVSS Score

Basic Information

EPSS Score
-
Published
9/8/2025
Updated
9/8/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
@modelcontextprotocol/inspectornpm< 0.16.60.16.6

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability is a Cross-Site Scripting (XSS) issue in the MCP Inspector's OAuth flow, which can be escalated to arbitrary command execution. The root cause is the failure to properly validate the authorizationUrl received from a potentially malicious remote MCP server before using it in client-side redirects or links.

The analysis of the patch commit 650f3090d26344a672026b737d81586595bb1f60 reveals several locations where this untrusted URL was handled insecurely:

  1. In AuthDebugger.tsx, a useEffect hook triggered an automatic redirect using window.location.href without any validation.
  2. In OAuthFlowProgress.tsx, the URL was used directly in an <a> tag's href attribute and in a window.open call, both of which are vulnerable to javascript: URIs if a user clicks them.
  3. In auth.ts, the InspectorOAuthClientProvider.redirectToAuthorization method had a weak protocol check before redirecting, which was insufficient.

A malicious server could provide an authorizationUrl with a javascript: scheme. When the MCP Inspector client processed this URL, it would execute the embedded script in the user's browser. According to the advisory, this XSS could then be used to interact with the inspector's proxy, leading to arbitrary command execution on the user's machine.

The fix involves introducing a new centralized utility function, validateRedirectUrl, which strictly ensures that any URL used for redirection has either an http: or https: protocol. This function is now called in all the previously vulnerable locations before the URL is used, effectively mitigating the XSS threat.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n XSS issu* w*s r*port** in t** M*P Insp**tor lo**l **v*lopm*nt tool w**n *onn**tin* to *n untrust** r*mot* M*P s*rv*r wit* * m*li*ious r**ir**t URI. T*is *oul* ** l*v*r**** to int*r**t *ir**tly wit* t** insp**tor proxy to tri***r *r*itr*ry *omm*n*

Reasoning

T** vuln*r**ility is * *ross-Sit* S*riptin* (XSS) issu* in t** M*P Insp**tor's O*ut* *low, w*i** **n ** *s**l*t** to *r*itr*ry *omm*n* *x**ution. T** root **us* is t** **ilur* to prop*rly v*li**t* t** `*ut*oriz*tionUrl` r***iv** *rom * pot*nti*lly m*