Skip to content

← Actionable
High, CVSS 8.8amended

OpenCode's Unauthenticated HTTP Server Allows Arbitrary Command Execution

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

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (opencode-ai 1.0.216), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
8.8 · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
  • CVE-2026-22812: 16.54% estimated exploitation activity in the next 30 days; percentile 97.01 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

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…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-vxw4-wv6m-9hhh

  2. Revision 1 · created ·

    Published from osv record GHSA-vxw4-wv6m-9hhh

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-22812

Advisory: OpenCode's Unauthenticated HTTP Server Allows Arbitrary Command Execution
IDs: CVE-2026-22812, GHSA-vxw4-wv6m-9hhh
Record: https://patchnext.com/advisories/cve-2026-22812 (revision 2, source checked 26 Oct 2026, 12:41 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: High (CVSS 8.8)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: opencode-ai 1.0.216. A vendor fix does not mean a deployment is fixed.

## Affected components
- npm opencode-ai: affected < 1.0.216; fixed in 1.0.216

## Suggested inspection (read-only)
- `npm ls opencode-ai --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on opencode-ai.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-vxw4-wv6m-9hhh (OSV record GHSA-vxw4-wv6m-9hhh lists affected ranges: npm opencode-ai >=0 <1.0.216 (fixed))
- Verified: https://github.com/advisories/GHSA-vxw4-wv6m-9hhh (GitHub-reviewed advisory GHSA-vxw4-wv6m-9hhh lists affected ranges: npm opencode-ai >=0 <1.0.216)

Commands are suggestions: review each one before running it.

Loading voting…