OpenCode — Vulnerability (CVE-2026-22813)
Date: 2026-01
Affected: anoma/opencode
Attack vector: xss
Category: vulnerability-disclosure
Severity: Medium
CVE: CVE-2026-22813
CWE: CWE-79
CVSS: 6.1 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N)

OpenCode is an open source AI coding agent. The markdown renderer used for LLM responses will insert arbitrary HTML into the DOM. There is no sanitization with DOMPurify or even a CSP on the web interface to prevent JavaScript execution via HTML injection. This means controlling the LLM response for a chat session gets JavaScript execution on the http://localhost:4096 origin. This vulnerability is fixed in 1.1.10.


Mitigations:

Architectural layers (MAESTRO):