Skip to content

← Public intelligence

npm package

opencode-ai

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

2 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Critical, CVSS 9.4npmAmendedPublished

    Malicious website can execute commands on the local system through XSS in the OpenCode web UI

    CVE-2026-22813 · GHSA-c83v-7274-4vgp

    Affected
    • npm opencode-ai < 1.1.10
    Fixed in
    1.1.10· Vendor fix available
    Issue
    A malicious website can abuse the server URL override feature of the OpenCode web UI to achieve cross-site scripting on http://localhost:4096. From there, it is possible to run arbitrary commands on the local system using the /pty/ endpoints provided by the OpenCode API. Code execution via OpenCode API - The OpenCode API has /pty/ endpoints that allow spawning arbitrary processes on the local machine. - When you run opencode in your terminal, OpenCode automatically starts an HTTP server on localhost:4096 that exposes the API along with a web interface. - JavaScript can make arbitrary same-origin fetch() requests to the /pty/ API endpoints. Therefore, JavaScript execution on http://localhost:4096 gets you code execution on local the machine. JavaScript execution on localhost:4096 The markdown renderer used for LLM responses will insert arbitrary HTML into the DOM. There is no sanitization with DOMPurify or even a CSP on the web interface to prevent JavaScript execution via…

    Recommended action: Upgrade to 1.1.10 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.com (1)osv.dev (2)Source checked Evidence →
  2. High, CVSS 8.8npmAmendedPublished

    OpenCode's Unauthenticated HTTP Server Allows Arbitrary Command Execution

    CVE-2026-22812 · GHSA-vxw4-wv6m-9hhh

    Affected
    • npm opencode-ai < 1.0.216
    Fixed in
    1.0.216· Vendor fix available
    Issue
    Previously reported via email to support@sst.dev on 2025-11-17 per the security policy in opencode-sdk-js/SECURITY.md. No response received. Summary OpenCode automatically starts an unauthenticated HTTP server that allows any local process—or any website via permissive CORS—to execute arbitrary shell commands with the user's privileges. Details When OpenCode starts, it spawns an HTTP server (default port 4096+) with no authentication. Critical endpoints exposed: - POST /session/:id/shell - Execute shell commands (server.ts:1401) - POST /pty - Create interactive terminal sessions (server.ts:267) - GET /file/content?path= - Read arbitrary files (server.ts:1868) The server is started automatically in cli/cmd/tui/worker.ts:36 via Server.listen(). No authentication middleware exists in server/server.ts. The server uses permissive CORS (.use(cors()) with default Access-Control-Allow-Origin: ), enabling browser-based exploitation. PoC Local exploitation: Browser-based exploitation: A…

    Recommended action: Upgrade to 1.0.216 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →