Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-22813: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in anomalyco opencode

0
Critical
VulnerabilityCVE-2026-22813cvecve-2026-22813cwe-79
Published: Mon Jan 12 2026 (01/12/2026, 22:52:35 UTC)
Source: CVE Database V5
Vendor/Project: anomalyco
Product: opencode

Description

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.

AI-Powered Analysis

AILast updated: 01/12/2026, 23:23:02 UTC

Technical Analysis

CVE-2026-22813 is a critical security vulnerability classified as CWE-79 (Improper Neutralization of Input During Web Page Generation, commonly known as Cross-site Scripting or XSS) found in the anomalyco OpenCode product, an open source AI coding agent. The vulnerability arises from the markdown renderer component used to display responses generated by the large language model (LLM) within the OpenCode web interface. Specifically, the renderer inserts arbitrary HTML content directly into the Document Object Model (DOM) without any sanitization mechanisms such as DOMPurify or the enforcement of a Content Security Policy (CSP). This lack of sanitization allows an attacker who can control the LLM's response in a chat session to inject and execute arbitrary JavaScript code within the context of the http://localhost:4096 origin. Because the origin is localhost, this can lead to significant security implications including theft of sensitive data, manipulation of the local application state, or further exploitation of the local environment. The vulnerability does not require any privileges or authentication to exploit but does require user interaction to trigger the malicious script execution. The vulnerability affects all OpenCode versions prior to 1.1.10, where it has been fixed. The CVSS 4.0 base score of 9.4 reflects the critical nature of this flaw, highlighting its network attack vector, low attack complexity, no privileges required, user interaction needed, and high impact on confidentiality, integrity, and availability. Although no known exploits have been reported in the wild, the potential for exploitation is significant given the widespread use of AI coding tools and the sensitive nature of local development environments.

Potential Impact

For European organizations, the impact of CVE-2026-22813 can be substantial, particularly for those integrating OpenCode into their AI development workflows or using it as part of local coding environments. Successful exploitation could lead to unauthorized code execution on developer machines, potentially exposing sensitive intellectual property, credentials, or internal network information. This could facilitate lateral movement within corporate networks or enable supply chain attacks if compromised code is pushed to production. The vulnerability’s exploitation on localhost means that attackers might leverage social engineering or malicious LLM prompts to trick users into executing harmful scripts. Given the critical CVSS score, the risk to confidentiality, integrity, and availability is high. Organizations relying on OpenCode for AI-assisted coding without proper mitigations could face data breaches, code integrity violations, or disruption of development processes. The lack of a CSP and sanitization also indicates a broader security design weakness that could be exploited in other ways if not addressed.

Mitigation Recommendations

To mitigate CVE-2026-22813, European organizations should immediately upgrade all OpenCode deployments to version 1.1.10 or later, where the vulnerability is patched. Additionally, implement strict Content Security Policies (CSP) on the OpenCode web interface to restrict the execution of unauthorized scripts and reduce the risk of XSS attacks. Incorporate robust input sanitization libraries such as DOMPurify to cleanse any HTML content rendered by the markdown renderer, preventing injection of malicious scripts. Conduct thorough code reviews and security testing of any custom integrations with OpenCode to ensure no additional injection vectors exist. Educate developers and users about the risks of interacting with untrusted LLM responses and enforce strict operational security policies around AI coding tools. Monitor local environments for suspicious activity and consider isolating AI coding tools in sandboxed environments to limit potential damage from exploitation. Finally, maintain up-to-date threat intelligence feeds to detect any emerging exploits targeting this vulnerability.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-01-09T22:50:10.288Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 69657efdda2266e838423035

Added to database: 1/12/2026, 11:08:45 PM

Last enriched: 1/12/2026, 11:23:02 PM

Last updated: 1/13/2026, 2:54:49 AM

Views: 11

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats