跳到正文
CVE news(thehackernews.com)·· 5 小時前精選AI 評分63

OpenCode 漏洞允許惡意 MCP 伺服器於 Windows 與 WSL 登入時執行程式碼

OpenCode Flaw Lets Malicious MCP Servers Execute Code During Sign-In on Windows and WSL

AI 導讀

**OpenCode AI 代理在 Windows 與 WSL 環境下的登入流程中,存在一個漏洞,惡意或被劫持的 MCP 伺服器可在使用者簽入時執行任意 PowerShell 指令。

推薦理由

此漏洞揭示了 OpenCode AI 代理在 Windows/WSL 環境下的安全風險,提醒使用者即時升級或移除不受信任的 MCP 伺服器以防止執行惡意程式。

正文 · 原文

Swati KhandelwalOct 22, 2026Vulnerability / Artificial Intelligence

A flaw in the OpenCode AI coding agent allowed a malicious or hijacked MCP server to run code on a developer's Windows or WSL machine when the developer signed in. OpenCode connects to MCP (Model Context Protocol) servers to add outside tools, and such code would run with the developer's own access.

Anomaly, the company behind OpenCode, fixed the flaw in version 1.18.33 on September 28. It did not request a CVE or publish a security advisory, so vulnerability scanners will not flag the builds still at risk: 1.0.137 through 1.18.32.

During that sign-in, the server itself supplies the web address the user is sent to, an OAuth "authorization endpoint." On Windows and WSL, OpenCode handed that address to a helper that opens it in a browser. The helper built a PowerShell command around the address without escaping it, so an address written to carry a PowerShell command would run that command.

The browser step runs only when a developer starts the sign-in, by running opencode mcp auth or making the matching request. Having the server configured, or opening a session, does not reach it.

The attacker needs control of a remote MCP server the developer has added, and that server need not be hostile from the start. One that is later taken over, or a domain that changes hands, could carry the same address.

Pillar Security, which found the flaw and disclosed it on October 19, rates it critical, with a proposed severity score of 9.8 out of 10.

The flaw affects OpenCode on Windows and the Windows Subsystem for Linux (WSL). macOS and Linux are not affected, because OpenCode opens the browser there without passing the address through a shell.

OpenCode shipped the fix as a routine change. The pull request that carried it is described as a refactor of browser-launch code, and neither it nor the release notes mention a security flaw.

Anomaly did not request a CVE or publish an advisory. Its security policy says MCP servers that a user configures are "outside our trust boundary."

Pillar reported the flaw privately on August 29 and later asked Anomaly to reconsider and request a CVE. Anomaly's answer was that a malicious MCP server falls outside its threat model, according to Pillar.

Because there is no CVE, the flaw will not show up in scanners or dependency alerts, so finding affected installs means checking the OpenCode version directly. Anomaly has published advisories for other OpenCode code-execution flaws this year, including one fixed in August.

The same kind of flaw has surfaced before. In July 2025, the mcp-remote proxy carried an almost identical bug, in which a malicious server's authorization endpoint reached the command line. It was assigned CVE-2025-6514.

OpenCode's browser helper is a widely used package called open. Its Windows behavior was reported as a command-injection risk in 2023 and fixed in open's version 11, but OpenCode stayed on an older release.

The usual defense for this class is to check that the address uses HTTP or HTTPS. It does not help here, because the attack uses an ordinary HTTPS address. OpenCode added that check as well, but the hole was closed by updating it to the fixed version.

What to Do

Anyone running OpenCode on Windows or WSL should upgrade and check which servers they are connected to.

  1. Upgrade to OpenCode 1.18.33 or later.
  2. If you cannot upgrade yet, remove any remote MCP servers you have not vetted from your OpenCode configuration.
  3. Run opencode mcp list to see which servers are configured.

Pillar reported no signs that the flaw has been used in attacks and published no indicators to check for past exploitation. The flaw is separate from a breach of OpenCode's hosted Console disclosed around the same time, which may have exposed some users' stored API keys for OpenAI, Anthropic, and Google.

Found this article interesting? Follow us on Google News, Twitter and LinkedIn to read more exclusive content we post.

來源: CVE news (thehackernews.com)
開啟原文