CVE-2026-22812: OpenCode unauthenticated HTTP server remote code execution

CVE-2026-22812 · Severity: low · CVSS 3.1 · Published 2026-01-13

OpenCode is a developer tool that automatically starts an unauthenticated HTTP server to provide IDE and command-execution capabilities. An attacker can execute arbitrary shell commands with the user's privileges either through malicious local processes or by directing the user to a compromised website—the server accepts requests from any origin via permissive CORS, making browser-based exploitation possible. This could enable complete system compromise, data theft, or deployment of malware.

Vendors: npm.

Quick answers

Is CVE-2026-22812 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-22812 being exploited in the wild.
How severe is CVE-2026-22812?
Low severity, with a CVSS score of 3.1, published 13 January 2026.
Which products and versions are affected?
opencode-ai (npm) SEMVER:introduced=0,fixed=1.0.216.
Is there a fix for CVE-2026-22812?
Yes. opencode-ai (npm): upgrade to 1.0.216 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-22812 attacked?
It is attacked over the network or with local access.
Am I affected by CVE-2026-22812?
Check whether you run opencode-ai (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • opencode-ai (npm): upgrade to 1.0.216 or later
    npm install opencode-ai@1.0.216

Technical details

The vulnerability is a missing authentication weakness (CWE-306) in OpenCode's HTTP server, which exposes critical endpoints including POST /session/:id/shell for arbitrary command execution, POST /pty for interactive terminal sessions, and GET /file/content for reading arbitrary files. The server is spawned automatically with no authentication middleware and uses permissive CORS (Access-Control-Allow-Origin: *), enabling cross-origin exploitation. Attack vectors include local exploitation via compromised npm packages or processes, and remote exploitation via malicious websites (confirmed working in Firefox without additional prompts). The vulnerability affects all versions prior to 1.0.216, which patches the issue. An attacker requires no privileges but user interaction may be required for browser-based exploitation; however, local processes can exploit without user interaction.

Affected products

  • OpenCode opencode-ai < 1.0.216

Identifiers

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

Timeline

  • 2026-01-12: disclosed: Published in NVD
  • 2026-01-13: disclosed: GitHub advisory GHSA-vxw4-wv6m-9hhh published
  • 2026-01-13: patched: Fixed in version 1.0.216
  • 2025-11-17: other: Vulnerability previously reported via email to support@sst.dev with no response

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.