AI agent · January 12, 2026

OpenCode local HTTP server let websites and local processes run commands and read files

ResolvedUpdated CVE-2026-22812CVE-2026-22813GHSA-vxw4-wv6m-9hhhGHSA-c83v-7274-4vgp

Two advisories published on 12 January 2026 showed that the OpenCode AI coding agent exposed its machine to other software. Before version 1.0.216, OpenCode started an unauthenticated HTTP server with permissive CORS that any local process or website could use to run shell commands and read files as the user (CVE-2026-22812). Before 1.1.10, its web UI rendered model output as raw HTML, giving JavaScript execution on the local origin (CVE-2026-22813). Update OpenCode, and rotate any keys on the machine if you ran an affected version while browsing untrusted sites.

DisclosedJanuary 12, 2026
AffectedOpenCode, opencode-ai, Anomaly
TypeAI agent
StatusResolved
CVECVE-2026-22812, CVE-2026-22813

What was exposed

The advisory lists the endpoints the unauthenticated server exposed: POST /session/:id/shell to run shell commands, POST /pty to open an interactive terminal, and GET /file/content?path= to read arbitrary files. Anything the user account could read was therefore reachable, including provider API keys in environment variables or config files, ~/.ssh keys, cloud credentials, .env files and Git credentials. Because CORS allowed any origin, the reporter showed a webpage could make these calls through the visitor's browser (confirmed in Firefox; Chrome 142 and later may ask for Local Network Access permission). With the --mdns flag the server bound to all interfaces, extending the exposure to the local network. The second flaw let anyone who could control a chat response, for example through prompt injection, run JavaScript on the http://localhost:4096 origin of the web UI. The advisories do not report exploitation in the wild.

Am I affected?

You are affected if you ran the opencode-ai CLI or desktop app below 1.0.216 (server issue) or below 1.1.10 (web UI issue). Check with opencode --version or npm ls -g opencode-ai. The risk was highest if you visited untrusted websites while OpenCode was running, used --mdns on a shared network, or installed untrusted local packages that could reach 127.0.0.1:4096. There are no published indicators that prove past exploitation, so judge exposure by version and usage.

What to do now

  1. Update OpenCode to the latest release (at least 1.1.10, which includes both fixes).
  2. If you ran an affected version while browsing untrusted sites or on a shared network, rotate the provider API keys, Git tokens and cloud credentials that were readable by your user account.
  3. Avoid --mdns on networks you do not control, and set OPENCODE_SERVER_PASSWORD when you run the server.
  4. Review shell history and recently modified files for commands you did not run.

Keys to rotate

Guides to the credentials this incident put at risk:

Timeline

  1. The reporter of GHSA-vxw4-wv6m-9hhh says they first emailed the issue to the maintainers on this date and received no response. Source
  2. OpenCode 1.0.216, the fixed version for the unauthenticated server issue, is published to npm. Source
  3. OpenCode 1.1.10, the fixed version for the web UI issue, is published to npm. Source
  4. Anomaly publishes GHSA-vxw4-wv6m-9hhh (high) and GHSA-c83v-7274-4vgp (critical); NVD records CVE-2026-22812 and CVE-2026-22813 the same day. Source

Indicators

From the advisories listed below. Use them to search your logs, lockfiles and workflow runs.

  • An OpenCode HTTP server listening on port 4096 or nearby without authentication, in versions below 1.0.216.
  • Requests to /session/:id/shell, /pty or /file/content from origins other than the OpenCode UI.

What this changes for credential handling

  • A local agent server is reachable by every process and, through the browser, every website. BotPassword keeps provider keys out of the agent's readable environment so a local compromise does not hand them over.

Frequently asked questions

Am I affected by the OpenCode incident?

You are affected if you ran the opencode-ai CLI or desktop app below 1.0.216 (server issue) or below 1.1.10 (web UI issue). Check with opencode --version or npm ls -g opencode-ai. The risk was highest if you visited untrusted websites while OpenCode was running, used --mdns on a shared network, or installed untrusted local packages that could reach 127.0.0.1:4096. There are no published indicators that prove past exploitation, so judge exposure by version and usage.

What was exposed in the OpenCode incident?

The advisory lists the endpoints the unauthenticated server exposed: POST /session/:id/shell to run shell commands, POST /pty to open an interactive terminal, and GET /file/content?path= to read arbitrary files. Anything the user account could read was therefore reachable, including provider API keys in environment variables or config files, ~/.ssh keys, cloud credentials, .env files and Git credentials. Because CORS allowed any origin, the reporter showed a webpage could make these calls through the visitor's browser (confirmed in Firefox; Chrome 142 and later may ask for Local Network Access permission). With the --mdns flag the server bound to all interfaces, extending the exposure to the local network. The second flaw let anyone who could control a chat response, for example through prompt injection, run JavaScript on the http://localhost:4096 origin of the web UI. The advisories do not report exploitation in the wild.

Which keys should I rotate?

Rotate any Anthropic, OpenAI, GitHub credentials that were reachable from affected systems, starting with the ones that can publish code or reach production.

Keep keys out of reach of the next compromised package

BotPassword is in early access. Request an invite and we'll email you when your spot opens.