Open and Shut: opencode remote code execution vulnerability via MCP OAuth
Open and Shut: Remote Code Execution in opencode via MCP OAuth
Pillar Security disclosed that the open-source AI coding agent opencode, with about 3 million weekly downloads, has a remote code execution vulnerability affecting versions 1.0.137 to 1.18.32 on Windows and WSL. During the OAuth authentication handshake, an attacker-controlled remote MCP server sends the free-form authorization_endpoint field in the discovery document directly to the shell, which passes it via the open package to PowerShell for execution, requiring no additional user interaction and not relying on prompt injection; the payload is an ordinary https URL. The vendor Anomaly fixed it in 1.18.33, released on 2026-09-28, but released it as a refactor, issued no security advisory and did not request a CVE, so vulnerability scanners and dependency alerts will not flag affected installations.
The author demonstrates that an ordinary https URL can bypass the common scheme validation, so teams building MCP clients can use this to check their own URL handling logic.