Junglewise Threat Intelligence

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

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

Vendors: npm.

Executive brief

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.

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

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

Related threats