Update OpenCode and remove MCP servers you don't trust
OpenCode flaw let a malicious MCP server run PowerShell during sign-in on Windows · Security incident · News · thehackernews · Oct 22, 2026
What happened
The Hacker News reported on 22 Oct that OpenCode on Windows and WSL passed the sign-in address supplied by an MCP server into a PowerShell command without escaping it, so a malicious or hijacked server could run code with the developer's own access when they ran opencode mcp auth. Pillar Security, which found it, rates it critical (proposed 9.8). Anomaly fixed it in 1.18.33 on 28 Sep but requested no CVE or advisory, so scanners will not flag builds from 1.0.137 to 1.18.32. macOS and Linux are not affected, and no attacks have been reported.
How to prevent it
Only connect your agent to MCP servers you trust and keep the agent updated, because a fix may ship without any security notice. Remove remote servers you no longer use. See our common AI security mistakes.
Fix prompt for your own AI tool
Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.
I use an AI coding agent that connects to MCP servers, possibly OpenCode on Windows or WSL. Help me check my setup. 1) Tell me how to find which version of OpenCode I run and whether it is older than 1.18.33 (affected versions are 1.0.137 to 1.18.32, Windows and WSL only). 2) Show me how to list every MCP server my agents are connected to (for OpenCode that is the command opencode mcp list), and which of them are remote servers I don't run myself. 3) Help me decide which servers I can remove, and how to remove them from my config. 4) Explain how to check that each remaining server's domain is still owned by the company I think it is. 5) Remind me to be careful when an agent asks me to sign in to an MCP server. Don't change anything until I've approved your plan. Never ask me to paste API keys, passwords or .env contents; tell me where to check them myself.
Why this keeps happening: trusting agents & ai input
An AI agent treats everything it reads as possible instructions: a web page, a README, an email, a code comment or the output of another tool. If that content was written by an attacker, the agent can be steered into running commands, reading files or sending data somewhere it should not.
A quick checklist before you ship
- Give each agent only the tools and folders it needs for the task at hand.
- Require manual approval before it runs shell commands, sends network requests, deletes files or spends money.
- Do not open untrusted repositories or MCP configs with auto-run turned on.
- Keep API keys and production credentials out of any environment an agent can read.
More on this: every trusting agents & ai input story and our related guide.
Tools involved
OpenCode stories, MCP stories, Windows stories
Related stories
- If you give an AI agent mcp-server-git, upgrade it to 2026.11.18 or later today, and don't point it at repos you haven't checked
mcp-server-git: six more ways a repo's own Git config could run commands, fixed in 2026.11.18 - Give AI assistant connectors their own scoped, short-lived tokens, never full session tokens
Mittwald's MCP server leaked customer session tokens, and an attacker used them to get into 56 hosting projects - Update mcp-server-git to 2026.11.11 or later, and only point it at repositories whose .git folder you trust
Reference Git MCP server ran attacker commands from a repo's own .git/config during read-only tools
Source: original post on News ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.