# Pillar Finds Remote Code Execution Flaw in OpenCode’s MCP OAuth

Published 2026-10-19 · AI.info Team · AI.info

> A malicious remote MCP server could exploit an OAuth discovery flow to run commands on affected OpenCode installations for Windows and WSL, Pillar Security says. The flaw was fixed in version 1.18.33 before Pillar published its report on October 4, 2026, the report says.

On October 4, 2026, [Pillar Security](https://www.pillar.security/blog/open-and-shut-remote-code-execution-in-opencode-via-mcp-oauth) published a report on a remote-code-execution flaw in OpenCode, an AI coding agent, that could let a hostile remote MCP server run commands on a developer’s Windows machine. The attack travels through OAuth discovery: metadata supplied by the server reaches OpenCode’s browser-launching code, which invokes PowerShell. The vulnerability affects OpenCode versions 1.0.137 through 1.18.32 on Windows and Windows Subsystem for Linux (WSL), Pillar says.

> “The attack does not require installing malicious software, exploiting the AI model or tricking it through prompt injection.”
>
> Eilon Cohen, report author

## OAuth discovery feeds a server-controlled URL to PowerShell

During authentication, a remote Model Context Protocol server can answer with a 401 response and a `WWW-Authenticate` challenge directing the client to discovery documents. Those documents supply an `authorization_endpoint`—a URL chosen by the server. In OpenCode 1.18.32, Pillar found, that value passed through the MCP software development kit and the agent’s OAuth and browser code before reaching the `open` package.

The vulnerable Windows path used `open@10.1.2`, which passed the target URL to PowerShell inside a double-quoted string. PowerShell evaluates `$(...)` expressions inside double quotes, so a crafted URL could cause a command to run as part of the browser launch. The command could execute even if the browser subsequently failed to open, and OpenCode discarded that launch error, Pillar says.

The attack does not depend on a developer approving a tool call or following a prompt-injection instruction, according to Pillar. A server could also become hostile after it was first configured: the malicious response arrives when the client connects and starts the OAuth process. Since OpenCode runs with the developer’s privileges, successful execution can act with those same privileges.

## HTTPS checks did not stop the payload

URL scheme filtering might appear to address the risk, but Pillar says its test URL used ordinary HTTPS. The MCP TypeScript SDK’s denylist blocks schemes such as `javascript:`, `data:` and `vbscript:`; an HTTPS address passes that check. The scheme check added in OpenCode 1.18.33 would not, by itself, reject the payload, Pillar also says.

The fix that closed the vulnerable path was an update to `open@11.0.4`, which wraps the target in single quotes rather than double quotes. PowerShell does not expand expressions inside single-quoted strings. Pillar’s finding is a reminder that validating a URL’s scheme does not make it safe to interpolate the full URL into a shell command.

The report places the flaw in a class of command-injection issues previously documented in three 2025 CVEs: CVE-2025-6514, CVE-2025-58062 and CVE-2025-10619. The vulnerable OpenCode code was written in December 2025, after those disclosures, Pillar says. Pillar recommends that MCP clients pass remote values as arguments rather than construct shell commands from them.

## The fix shipped before Pillar’s disclosure

Anomaly, OpenCode’s developer, released version 1.18.33 on September 28, according to Pillar, after receiving the researchers’ report. The release included the dependency update, but Anomaly did not publish a security advisory or request a CVE for this issue, Pillar says. The researchers assign a proposed CVSS 3.1 score of 9.8; that is their assessment, not a published CVE rating.

Pillar quotes Anomaly’s response to the report as follows:

> “we've updated the dependency, but generally, trying to deal with a malicious MCP server is outside our threat model.”
>
> Anomaly, as quoted in Pillar Security’s report

Anomaly considered malicious remote MCP servers outside its threat model, Pillar says. That position matters for anyone using a remote server: a configuration can point to a service that later changes, while an automated OAuth handshake processes its response. macOS and Linux are not affected by this particular execution path because their browser launchers do not pass the URL through a shell, the report says.

## Windows and WSL users need to check versions directly

Without a CVE for this finding, conventional vulnerability scanners and dependency alerts may not flag affected OpenCode installations, Pillar warns. Teams should check versions themselves, focusing on Windows and WSL hosts that have remote MCP servers configured. The report lists OpenCode 1.18.33 or later as patched and advises removing unvetted remote MCP servers if an upgrade is not possible.

OpenCode had approximately 3 million weekly npm downloads and 211,000 [GitHub](https://ai.info/companies/github) stars at the time of Pillar’s report. For affected users, the immediate step is specific: verify the installed version, then upgrade to at least 1.18.33.

## Sources

1. Original source · Blog post [Pillar Security](https://www.pillar.security/blog/open-and-shut-remote-code-execution-in-opencode-via-mcp-oauth) pillar.security

## Related stories

- [Breach Affected 1.4% of OpenCode Console Users, Company Says](https://ai.info/news/opencode-breach-exposed-keys-console-users)
- [Mohiuddin Finds MCP Security Bugs Across Five Organizations](https://ai.info/news/mohiuddin-mcp-security-bugs-five-organizations)
- [Google engineer joins shared stewardship of Agent Skills and MCP](https://ai.info/news/google-agent-skills-mcp-aaif-stewardship)
- [Apiiro Finds Claude Code Approval Files Leaking Secrets on GitHub](https://ai.info/news/apiiro-claude-code-dont-ask-again-secrets-github)
- [Anthropic Opens Claude Plugin Submissions Through a Developer Portal](https://ai.info/news/anthropic-opens-claude-plugin-submissions)

## Explore

[More articles](https://ai.info/news)

---

Canonical: https://ai.info/news/pillar-opencode-mcp-oauth-remote-code-execution
