A malicious MCP server could run code on Windows during OpenCode sign-in
Pillar Security showed that a remote MCP server could make OpenCode run commands on a Windows or WSL machine during OAuth sign-in. The fix shipped without a CVE or advisory.
Demonstrated. Demonstrated by researchers. No real-world exploitation confirmed. The severity shown is potential.
- Disclosed
- Published
- Organization
- Anomaly
- System
- OpenCode AI coding agent on Windows and WSL
- Impact
- Remote code execution with the developer’s privileges in versions 1.0.137 to 1.18.32; no exploitation reported
- Root cause
- A server-supplied OAuth address was passed unescaped into a PowerShell command by an outdated browser-launch package
Timeline
- 2026-08-29. Pillar Security reports the flaw privately.
- 2026-09-28. Anomaly releases OpenCode 1.18.33 with the fix.
- 2026-10-19. Pillar publishes its findings.
- 2026-10-22. The Hacker News reports on them.
Trigger or entry point
A remote MCP server that the developer has configured, during the OAuth sign-in flow. The flaw is reached only when the developer starts that sign-in, not by having the server configured or opening a session, according to The Hacker News. According to Pillar, the server did not need to be malicious when it was added: a later takeover or an expired domain could deliver the same response.
Failure mechanism
During sign-in, the MCP server tells the client which authorization address to open. OpenCode passed that address to the browser-launch package open, version 10.1.2. On Windows, that version built a PowerShell command without escaping the address, so shell syntax inside an ordinary https address was executed. macOS and Linux were not affected, according to both sources. Pillar notes that the common defense, checking the URL scheme, would not have stopped it.
Impact
Code execution on the developer’s machine with the developer’s privileges, in OpenCode versions 1.0.137 to 1.18.32 on Windows and WSL. Pillar proposes a CVSS score of 9.8. Pillar reported no signs of exploitation, according to The Hacker News.
Response
Anomaly fixed the issue in 1.18.33 by updating the dependency and adding a scheme check. The fix shipped as a refactor: neither the pull request nor the release notes mention a security flaw, according to both sources. It did not publish an advisory or request a CVE. According to Pillar, Anomaly said a malicious MCP server falls outside its threat model. The Hacker News notes that scanners therefore will not flag affected versions.
Mitigations
Upgrade to OpenCode 1.18.33 or later. Until then, remove remote MCP servers that have not been vetted. Pillar recommends checking installed versions directly, because no CVE exists to trigger alerts.
Engineering takeaway
- Failure pattern
- A field chosen by a remote server flowed into a shell command on the developer’s machine without escaping.
- Preventive control
- Treat every field in an MCP server response as untrusted input, launch URLs without a shell, and keep browser-launch dependencies current.
- Transferable lesson
- Scheme checks on URLs are not enough when a valid https address can still carry shell syntax.
Editorial summary by Incidents.si, drawn from the sourced record above. It is not a statement by the organizations involved.
Sources
- Open and Shut: Remote Code Execution in opencode via MCP OAuthprimary · 2026-10-19
- OpenCode Flaw Lets Malicious MCP Servers Execute Code During Sign-In on Windows and WSLsecondary · 2026-10-22
Corrections
No corrections have been made to this entry.
Report a correction