CVE-2026-22812

OpenCode, Open Season: Unauthenticated RCE via Localhost

Amit Schendel
Amit Schendel
Senior Security Researcher

Jan 14, 2026·6 min read·43 visits

Executive Summary (TL;DR)

OpenCode versions < 1.0.216 automatically start a local HTTP server on port 4096. Due to missing authentication and a wildcards-allowed CORS policy, any website you visit can send requests to `localhost:4096`, spinning up a shell and executing commands with your privileges. It is a zero-click drive-by RCE.

OpenCode, a popular AI coding agent, inadvertently turned developer machines into public APIs. By launching an unauthenticated HTTP server with permissive CORS on localhost, the tool allowed any website visited by a developer to execute arbitrary shell commands. It’s a classic case of 'convenience over security' resulting in a critical Remote Code Execution (RCE) vulnerability.

Fix Analysis (2)

Technical Appendix

CVSS Score
8.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS Probability
0.10%
Top 71% most exploited

Affected Systems

OpenCode AI Agent

Affected Versions Detail

Product
Affected Versions
Fixed Version
opencode
anomalyco
< 1.0.2161.0.216
opencode
anomalyco
< 1.1.101.1.10
AttributeDetail
CWE IDCWE-942 (Permissive CORS)
Attack VectorNetwork (Drive-by Web)
CVSS8.8 (High)
ImpactRemote Command Execution (RCE)
EPSS Score0.10%
Exploit StatusFunctional PoC Available
CWE-942
Permissive Cross-domain Policy with Untrusted Domains

Permissive Cross-domain Policy with Untrusted Domains

Vulnerability Timeline

Vulnerability reported to vendor
2025-11-17
Patch v1.0.216 released (CORS fix)
2025-12-30
Patch v1.1.10 released (Disable server default)
2026-01-09
Public Disclosure
2026-01-11