The Server Chose the URL: How MCP Inspector Ran Code Before It Listed a Tool
The first request the MCP Inspector sends to a remote server is a POST /mcp. If the server wants OAuth, the answer is a 401 with a WWW-Authenticate header. On Windows and WSL, in Inspector 2.11.0, that response was enough to run code on the workstation. No tool had been listed yet. No consent prompt had appeared. The browser that was supposed to open never did, and the error the user saw blamed the browser.
The scenario is a composite of the published timeline, not a specific victim. The reproduction further down is real: it ran the shipped Inspector 2.11.0 CLI against a local mock server, and the payload executed. The fixed build, run against the same server, did not execute it. Both outputs are quoted verbatim.
What a client is allowed to believe
The Inspector exists to answer one question: what does this server actually expose? Its design assumes the server may be hostile. That is why the finding matters more than its CVSS score. A client that is built to look at untrusted servers cannot afford to trust the first document it receives.
OAuth discovery is a chain of documents the server controls. RFC 9728 protected resource metadata tells the client where its authorization server lives. RFC 8414 metadata then names the issuer, the authorization_endpoint, the token_endpoint, and often a registration endpoint. The client has no independent way to verify those URLs: they are the thing being discovered.
In the published 2.11.0 CLI bundle, isAuthorizationServerMetadata() accepts an object when issuer is a string and either authorization_endpoint or token_endpoint is a string. There is no protocol check and no origin check at that boundary. The asymmetry with the rest of the code is the interesting part. URLs supplied by the operator through overrides go through oauthEndpointUrlError(), which requires a parseable absolute URL, permits only http and https, and rejects embedded credentials. Local configuration is validated strictly. The remote document is accepted because a field happens to be a string.
That inversion is not unique to this project. Every client that implements the flow inherits the same question: what happens when the string reaches a local launcher?
From a JSON field to a command string
In 2.11.0, the navigation handler calls openUrl(href) from core/node/openUrl.ts, which imports the open package and calls it with a five second timeout. The browser not opening is treated as a failure worth reporting, but not as a security event.
On Windows and WSL, the open package before version 11.0.0 builds a PowerShell command rather than passing a URL to a browser. The 10.2.0 source assembles Start -Wait "<target>", encodes the string as UTF-16LE, base64-encodes it, and spawns powershell.exe with -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand. The package comment explains the intent: base64 is used “to allow special characters”. That is also the design flaw in one sentence. The target is interpolated into a language, not passed as an argument.
PowerShell has two string forms with different rules. Inside double quotes, $( ) is a subexpression and runs. Inside single quotes it is literal text. So a URL that contains $([IO.File]::WriteAllText('C:\path','x')) is a valid URL and a valid program, depending only on which quote character surrounds it. The CVE record describes the outcome as OS command injection, CWE-78, with a CVSS 4.0 score of 7.7.
Two details make the chain quiet. The -EncodedCommand argument hides the payload from a casual look at the process list, and windowsVerbatimArguments prevents the runtime from re-quoting the arguments on the way to CreateProcess. The visible failure, if any, is a browser that did not open, which is a normal thing for a headless or locked-down workstation to report.
The chain in six steps

- The operator points the Inspector at a remote server, often one from a ticket, a README, or a marketplace entry.
- The server replies 401 and advertises a protected resource metadata document.
- The client fetches that document and then the authorization server metadata.
- The metadata names an
authorization_endpointunder the server’s control. In the lab it washttps://evil.test/$( ... ), a syntactically valid HTTPS URL. - The client appends its own query parameters and calls
open(). On an interactive terminal, auto-open is enabled by default unlessMCP_AUTO_OPEN_ENABLED=falseis set. - PowerShell evaluates the subexpression, then
Startfails because there is no browser to reach. The user sees a browser complaint. The payload has already run.
Reproducing it in the lab
Pillar Security published the finding with a source-level walkthrough in November 2026. The test here used a local mock MCP server that answers every request with a 401 pointing at its own metadata, then serves an authorization server document whose endpoint is the payload. The hostname evil.test is reserved by RFC 2606, so nothing leaves the machine even if a browser tries to resolve it. The Inspector ran with MCP_AUTO_OPEN_ENABLED=true because the lab has no TTY; on a developer workstation the default already opens the URL when stderr is a terminal.
Inspector 2.11.0 resolved [email protected] from its own dependency tree. The decoded command that reached PowerShell was, with lab paths shortened:
Start -Wait "https://evil.test/$([IO.File]::WriteAllText('/lab/PWNED-e2e.txt','E2E-RCE'))?response_type=code&client_id=lab-client&code_challenge=...&resource=http%3A%2F%2F127.0.0.1%3A8791%2Fmcp"
The client had appended its own OAuth parameters after the path, exactly as the flow requires, and the file was written before the CLI settled into waiting for a callback that never came. The process tree was node to powershell, with the payload only visible after base64 decoding.
Two controls make the result attributable. The same payload passed to [email protected] produced no file. The decoded command shows why:
Start -Wait 'https://evil.test/$([IO.File]::WriteAllText(''/lab/PWNED-e2e.txt'',''E2E-RCE''))?response_type=code&...'
Version 11 wraps the target in single quotes and doubles the internal ones. Nothing is interpolated. In this lab, Inspector 2.15.0 run against the same mock server printed the authorization URL and did not launch it; its openUrl() now routes through toOpenableHref(), which permits only http and https and opens the parsed href rather than the raw input.
One substitution is worth stating plainly. The lab host is Linux, so the Windows branch’s hardcoded powershell.exe path was redirected to PowerShell 7.7.0. The command construction, the UTF-16LE encoding, the spawn flags, and the interpolation are the package’s own code. Windows PowerShell 5.1 was not exercised, and its string rules on this input are the same.
The fix is a pair of quotes
The MCP Inspector RCE is a dependency bug that became a client bug. The root cause fix was not a URL filter. It was moving to open@11, which escapes the target with powershell-utils and encodes the command through the same helper. The Inspector bumped the dependency to 11.0.4 and restricted the scheme. The scheme check is defense in depth: the lab payload is valid HTTPS and would pass it.
The distribution problem is the part most teams will get wrong. The published 2.11.0 package pinned open to ^10.2.0, and a caret range never resolves to 11. A routine npm update leaves the vulnerable copy in place. Fixing it requires an explicit override or a lockfile change, in the same way that opencode needed 1.18.33 to close the same chain.
{
"overrides": {
"open": "^11.0.4"
}
}
CVE-2026-119025 exists because the bug shipped in three products that each misused the same package. Without a shared identifier, a security team would be cross-referencing three changelogs. With one record, scanners can flag the package and both applications.
Detecting the request that matters
Process creation is the strongest signal because the chain needs a shell. Look for powershell.exe whose parent is node.exe or an Electron process and whose command line contains -EncodedCommand. Node spawning PowerShell is not rare in developer fleets, so pair it with the parent command line mentioning inspector, mcp, or opencode, and with a network connection to a remote MCP host.
PowerShell script block logging does the decoding for you. Event 4104 records the plaintext script, so a block containing Start -Wait "http together with $([IO.File]:: is readable without touching base64. On networks, metadata responses that carry %24%28 or a literal $( in authorization_endpoint are worth alerting on, and so is the first /.well-known/oauth-authorization-server request from a developer segment to a newly registered domain.
The endpoint symptom is easy to miss: a CLI that reports it could not open a browser, followed by a stalled OAuth callback. If the tool normally opens a tab and suddenly stops, treat that as a lead rather than a browser issue.
Dependency inventory closes the gap that version numbers hide. Query lockfiles and SBOMs for open below 11.0.0 even when the Inspector looks current, because the transitive copy is the one that ran.
What to change this week
- Inspector 2.12.0 or later,
opencode1.18.33 or later, andopen11.0.0 or later, including transitive copies. - Treat authorization server metadata as untrusted input: require https, allow http only on loopback, and compare the endpoint origin against the configured server where the specification allows it.
- Do not auto-open a URL chosen by a server. Print the full string and require one explicit action, and disable auto-open in automation with
MCP_AUTO_OPEN_ENABLED=false. - Escape at the sink. Filtering URLs for
$(is bypassable; correct quoting is not. - Inspect untrusted servers from a disposable host without cloud tokens, browser profiles, or SSH agents.
Limits and takeaways
The vulnerability is specific to Windows and WSL, needs an OAuth-capable remote server, and, in the CLI path, reaches code execution through auto-open. The lab exercised the real Inspector releases against a mock server on Linux and did not test Windows PowerShell 5.1 or a production MCP deployment. The reachability was validated in the shipped bundle and confirmed by the vendor fix, not inferred from the advisory.
Three things stay with me after this test. First, the inspection client is part of the attack surface, and the tool you use to look at hostile software deserves the same suspicion as the software. Second, quoting is a security boundary. Every “special characters” workaround is a place where data becomes syntax. Third, users patch products, not dependencies, so cross-product CVE records and dependency overrides matter more than a changelog entry.
The earlier MCP work on this site followed related threads: approval dialogs that do not mean what they appear to mean, sandbox policy that never runs where it counts, and tool parsers that turn model output into code. This case is the same pattern one layer earlier: the client’s own navigation code becomes the interpreter.
💜 Enjoyed this content? Support the blog with USDT (TRC20):
TX7obcjHQbDUXb4mGqoASEu1QFTKT2CFGG
