CVE-2026-22813: OpenCode localhost web UI XSS leading to local command execution
- Vendor
- Anoma
CVE-2026-22813 is a cross-site scripting vulnerability in OpenCode, an open source AI coding agent. The OpenCode web interface renders LLM/chat markdown responses and inserts arbitrary HTML into the DOM without sanitization, and the interface also lacks a Content Security Policy sufficient to prevent script execution. As described in the provided content, an attacker who can control an LLM response in a chat session, including via the web UI's server URL override feature, can inject malicious HTML/JavaScript that executes in the security context of the OpenCode web UI origin at http://localhost:4096. Because that origin has access to the local OpenCode API, the XSS can be used to issue requests to sensitive localhost endpoints and bridge from browser script execution to local system command execution. The issue is reported fixed in OpenCode 1.1.10.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation allows attacker-controlled JavaScript to execute in the OpenCode localhost web UI origin and interact with the local OpenCode API. Per the supplied context, this can be used to access endpoints that spawn arbitrary processes, resulting in arbitrary command execution on the victim developer workstation. The practical impact is full compromise of the local system in the context available to the OpenCode process/user, enabling execution of malicious code, access to local resources exposed through the API, and follow-on workstation compromise.
Mitigation
If you can’t patch tonight, do this now.
Apply the vendor update immediately. Until patched, reduce exposure by disabling or avoiding the vulnerable web UI where possible, preventing untrusted content from being rendered in chat sessions, and avoiding use of the server URL override behavior referenced in the exploit chain. Restrict access to the localhost OpenCode interface/API from the browser environment as much as operationally possible. Because any XSS in the localhost UI is high impact, minimizing or disabling the local web interface is the most effective temporary mitigation short of upgrading.
Remediation
Patch, then assume compromise.
Upgrade OpenCode / the npm package opencode-ai to version 1.1.10 or later, which is identified in the provided content as the fixed version. The supporting advisory also notes a server-side change to stop honoring the ?url= server URL override parameter, removing the specific XSS vector described. More generally, remediation should include proper HTML sanitization of rendered LLM output and enforcement of a restrictive CSP in the web UI.
Exploits
No validated public exploits yet. Hidden: 1 rejected by Mallory's analysis as not a working exploit.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Frequently asked questions
- Is CVE-2026-22813 exploited in the wild?
- As of Oct 16, 2026, Mallory has no reports of CVE-2026-22813 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2026-22813?
- Yes. As of Oct 16, 2026, Mallory has reports of a public exploit for CVE-2026-22813.
- Is there a patch for CVE-2026-22813?
- Upgrade OpenCode / the npm package opencode-ai to version 1.1.10 or later, which is identified in the provided content as the fixed version. The supporting advisory also notes a server-side change to stop honoring the ?url= server URL override parameter, removing the specific XSS vector described.
- What products are affected by CVE-2026-22813?
- Anoma Opencode.
- How severe is CVE-2026-22813?
- CVE-2026-22813 has a CVSS v4 score of 9.4 (Critical) and an EPSS score of 0.40% (26th percentile) as of Oct 16, 2026.
Recent activity
7 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.