OpenCode AI Coding Agent RCE via Unauthenticated Local Server and Web UI XSS
Emerging Technology Risk · 3 sources · Updated 5mo ago · First seen Jan 14, 2026

Security researchers disclosed two high-severity vulnerabilities in the open-source OpenCode AI coding agent that can allow arbitrary command execution on a developer workstation in drive-by scenarios. CVE-2026-22812 stems from OpenCode automatically starting an unauthenticated HTTP server with permissive CORS (Access-Control-Allow-Origin: *), enabling any local process—or a malicious website via cross-origin requests—to invoke sensitive local API endpoints and execute shell commands with the user’s privileges. Separately, CVE-2026-22813 is a critical issue in the OpenCode web UI where the markdown renderer can inject arbitrary HTML into the DOM without sanitization (no DOMPurify and no CSP), enabling JavaScript execution on the http://localhost:4096 origin and subsequent access to local APIs that can spawn processes.
Mitigations are available for both OpenCode issues: CVE-2026-22812 is fixed in OpenCode 1.0.216, and CVE-2026-22813 is fixed in OpenCode 1.1.10. Other items in the set describe unrelated vulnerabilities in different products (e.g., a command-injection flaw in an end-of-life VS Code extension, unsafe deserialization in LlamaIndex, ReDoS in LangChain, and various web app SQLi/XSS/access-control issues) and do not materially change the OpenCode risk picture; they should be tracked separately by affected-asset ownership and exposure.
Why it matters
Impact assessment
OpenCode users, especially developers running the agent locally on workstations, are directly affected. The impact is severe because both flaws can lead to arbitrary command execution with the current user’s privileges, enabling code execution, file access, credential theft, and downstream compromise of developer environments.
The exposure is broad for organizations that permit OpenCode on endpoints because exploitation can occur in drive-by scenarios from a malicious website while the local service is running. The story describes credible exploitation paths from the web into localhost services, but it does not provide confirmed in-the-wild exploitation incidents.
Supporting facts
- Affected product: OpenCode open-source AI coding agent.
- Affected population: developers and users running OpenCode on local workstations.
- Primary business risk: workstation compromise, source code exposure, credential theft, and potential lateral movement from developer endpoints.
- Scope: potentially widespread across any environment using vulnerable OpenCode versions prior to fixed releases.
- Exploitation conditions: user interaction is required for at least CVE-2026-22812, and malicious website exposure can trigger drive-by exploitation.
- Known exposed capabilities include shell command execution and arbitrary file reads from the local machine.
- No explicit public reporting of active exploitation in the wild was included in the references.


