Pillar 披露 opencode MCP 登录缺陷:远程服务器可在 OAuth 时跑本地代码
Pillar Security 披露开源编程智能体 opencode 在 Windows/WSL 上的严重缺陷:远程 MCP 可在 OAuth 登录阶段执行本地代码;修复曾随浏览器启动重构静默合入。同时提醒 MCP Inspector 同类问题需大版本升级。
Pillar Security 于 10 月 19 日披露开源编程智能体 opencode 的一处严重问题:在 Windows 与 WSL 上,远程 MCP 服务器可在 OAuth 登录过程中于本机执行代码,且不依赖提示词注入或模型参与。机制并不花哨——服务器自选授权 URL,opencode 把它交给辅助逻辑拼进 PowerShell 命令却未做转义,URL 里的子表达式就会以当前用户身份执行。
两天后,MCP Inspector 也发布了同类问题的公告;建议修复涉及 open 包的大版本升级,而 10.x 的 caret 范围不会自动解析到 11.x,常规 npm update 可能装不到。更值得警惕的是:opencode 已在 9 月 28 日的 1.18.33 以「浏览器启动重构」形式修好,却没有 advisory、也没有 CVE,扫描器可能完全看不到。
本周可做的最小动作:列出 Agent 能连到的全部 MCP(例如 opencode mcp list)、移除未审核的远程服务器、钉死工具版本并读 diff 而不是只看 release notes,并把服务器域名易主视为供应链事件。连接 MCP 等同于安装软件——第一天无害,不代表登录那天仍然无害。
以上整理仅供行业观察,具体以官方文档与仓库为准。
以上整理仅供行业观察,具体以官方文档与仓库为准。
Pillar Security opencode MCP OAuth bug
Connecting an MCP server is installing software. Treat it that way.
On Oct 19, Pillar Security disclosed a critical bug in opencode, the open-source coding agent. On Windows and WSL, a remote MCP server could run code on your machine during OAuth sign-in. No prompt injection. No model involved.
The mechanism is boring, which is the point. The server picks the authorization URL. opencode handed that URL to a helper that built a PowerShell command around it without escaping it. A URL carrying a PowerShell subexpression ran as you.
Two days later, MCP Inspector published an advisory for the same bug class. Its suggested fix is a major bump of the open package, and a caret range on 10.x never resolves to 11.x, so a routine npm update won't pick it up.
The part that should bother you most: opencode fixed it in 1.18.33 on Sep 28, shipped as a browser-launch refactor, with no advisory and no CVE. Your scanner has nothing to flag.
What I'd do this week:
- List every MCP server your agents can reach (opencode mcp list is a start)
- Remove any remote server you haven't vetted
- Pin agent tool versions and read release diffs, not release notes
- Treat a server's domain changing hands as a supply chain event
The server doesn't need to be evil on day one. It needs to be evil the day you sign in.