OpenCode AI Coding Agent RCE via Unauthenticated Local Server and Web UI XSS
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.

Get ahead of threats like this
Mallory correlates global threat intelligence with your attack surface — know if you’re exposed before adversaries strike.
How this story unfolded
3 events from the most recent confirmed update back to the earliest known activity.
Technical details published on drive-by exploitation via malicious websites
Follow-up reporting explained that CVE-2026-22813 exploited an XSS condition in OpenCode's web UI and that CVE-2026-22812 involved an unauthenticated HTTP server with permissive CORS. The report highlighted exposed endpoints capable of spawning processes and reading arbitrary files from disk through localhost:4096.
Advisories disclose CVE-2026-22812 and CVE-2026-22813 in OpenCode
Security advisories disclosed CVE-2026-22812 and CVE-2026-22813, describing how malicious websites could abuse OpenCode's localhost services and web UI to execute commands on a developer's machine. The disclosures identified affected versions as OpenCode releases before 1.0.216 and rated the flaws high severity.
OpenCode releases version 1.0.216 to fix two critical flaws
OpenCode fixed two high-severity vulnerabilities affecting versions prior to 1.0.216, including an unauthenticated local HTTP server issue and an XSS flaw in the web UI. Updating to version 1.0.216 or later mitigates arbitrary command execution and related local file access risks.
Related entities
Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.
Sources
3 references tracked. Mallory keeps watching after this page renders.
Critical OpenCode Flaws Let Websites Hijack Your PC
securityonline.info
Open sourceCVE-2026-22812 - OpenCode's Unauthenticated HTTP Server Allows Arbitrary Command Execution
cvefeed.io
Open sourceCVE-2026-22813 - Malicious website can execute commands on the local system through XSS in the OpenCode web UI
cvefeed.io
Open sourceSee the full picture, correlated to your attack surface.
Map indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.


