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

CVE-2026-22813 is a critical cross-site scripting (XSS) vulnerability in the anomalyco OpenCode AI coding agent's markdown renderer. The renderer inserts arbitrary HTML into the DOM without sanitization or Content Security Policy (CSP), allowing JavaScript execution on the localhost web interface. This enables attackers who can influence the LLM response in a chat session to execute malicious scripts in the context of the http://localhost:4096 origin. The vulnerability affects OpenCode versions prior to 1. 1. 10 and requires no authentication but does require user interaction to trigger. Although no known exploits are currently in the wild, the high CVSS score of 9. 4 reflects the severe impact on confidentiality, integrity, and availability. The issue is fixed in version 1. 1.

AI-Powered Analysis

AILast updated: 01/21/2026, 03:05:13 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 from large language models (LLMs). This renderer directly inserts arbitrary HTML content into the Document Object Model (DOM) without applying any sanitization mechanisms such as DOMPurify or enforcing a Content Security Policy (CSP). Consequently, if an attacker can control or influence the LLM's response during a chat session, they can inject malicious JavaScript code that executes within the security context of the localhost web interface (http://localhost:4096). This local origin execution can lead to theft of sensitive data, manipulation of the user interface, or further exploitation of the host system. The vulnerability affects all OpenCode versions prior to 1.1.10, where the issue has been addressed. The CVSS 4.0 score of 9.4 indicates a critical severity, with an attack vector of network (remote), no privileges required, no user interaction needed beyond initiating the chat session, and a high impact on confidentiality, integrity, and availability. Although no public exploits have been reported, the nature of the vulnerability makes it a significant risk, especially in environments where OpenCode is used for development or automation tasks. The lack of CSP and sanitization is a fundamental security oversight that allows arbitrary script execution, which can be leveraged for session hijacking, data exfiltration, or pivoting attacks on the host machine.

Potential Impact

For European organizations, the impact of CVE-2026-22813 can be substantial, particularly for those integrating OpenCode into their development pipelines or AI-assisted coding environments. Successful exploitation could lead to unauthorized code execution on developer machines, potentially exposing sensitive source code, credentials, or internal APIs. This could compromise intellectual property and lead to further lateral movement within corporate networks. The vulnerability’s exploitation on localhost reduces the attack surface to users interacting with the vulnerable interface, but social engineering or supply chain attacks could trick users into triggering malicious LLM responses. Given the critical CVSS score, the risk to confidentiality, integrity, and availability is high. Organizations in sectors with stringent data protection requirements, such as finance, healthcare, and critical infrastructure, may face regulatory and compliance repercussions if exploited. Additionally, the AI coding agent’s role in automating code generation means that malicious script injection could propagate insecure code or backdoors into production systems, amplifying the threat.

Mitigation Recommendations

1. Immediate upgrade to OpenCode version 1.1.10 or later, where the vulnerability is patched. 2. Implement strict Content Security Policies (CSP) on the localhost web interface to restrict script execution sources and mitigate the impact of any injected scripts. 3. Integrate robust HTML sanitization libraries such as DOMPurify to cleanse any user or LLM-generated content before rendering it in the DOM. 4. Limit access to the OpenCode web interface to trusted users and networks, employing network segmentation and firewall rules to reduce exposure. 5. Educate developers and users about the risks of interacting with untrusted LLM responses and encourage verification of AI-generated content. 6. Monitor logs and network traffic for unusual activity related to the OpenCode interface, including unexpected script execution or data exfiltration attempts. 7. Consider running OpenCode in isolated environments or containers to contain potential exploitation impact. 8. Regularly review and update security configurations and dependencies to prevent similar vulnerabilities.

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/21/2026, 3:05:13 AM

Last updated: 2/5/2026, 9:07:43 PM

Views: 111

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