CVE-2026-22813: OpenCode AI XSS Vulnerability Allows Remote Command Execution

opencode-ai Updated 13 Jan 2026

Summary

13/01/2026
Yes i
Critical
9.4

CVE-2026-22813: Malicious website can execute commands on the local system through XSS in the OpenCode web UI. Affects opencode-ai versions < 1.1.10. Fixed in 1.1.10. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

OpenCode AI is an open-source tool designed for collaborative coding and AI-assisted programming. It features a web UI that allows users to interact with the application through a browser. The application runs a local HTTP server on localhost:4096, exposing various API endpoints for functionality. However, the web UI's lack of proper input sanitization has made it susceptible to cross-site scripting (XSS) attacks, which can lead to severe security risks.

Vulnerability Detail

The vulnerability arises from the OpenCode web UI's server URL override feature, which can be exploited by a malicious website to execute arbitrary JavaScript on the localhost. This XSS vulnerability allows attackers to run commands on the local system through the OpenCode API's /pty/ endpoints. The absence of sanitization mechanisms, such as DOMPurify or Content Security Policy (CSP), further exacerbates the risk, enabling attackers to inject malicious scripts into the web interface.

How To Fix

Latest published version: 1.19.4 as of 23 Oct 2026

npm install opencode-ai@1.19.4

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.1.10

This is the first release that contains the fix.

npm install opencode-ai@1.1.10

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can disable the web UI and API endpoints to reduce the attack surface of the application. This can be done by not starting the OpenCode server or by configuring it to restrict access.

Conclusion

The CVE-2026-22813 vulnerability in OpenCode AI poses a significant risk due to its potential for remote command execution via XSS. Users are strongly encouraged to upgrade to version 1.1.10 or later to mitigate this risk. Temporary workarounds can be employed, but upgrading is the most effective solution.

See every vulnerability recorded for opencode-ai →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 9.4, indicating a critical severity level.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check if your application is affected by visiting the Vulert playground at Vulert Scanner without any signup.

If exploited, this vulnerability can allow attackers to execute arbitrary commands on the local system, leading to data breaches, unauthorized access, and potential system compromise.

Yes, users can temporarily disable the web UI and API endpoints to reduce the attack surface until they can upgrade to the patched version.

If immediate upgrading is not possible, ensure that the OpenCode server is not exposed to untrusted networks and consider implementing additional security measures to limit access.

Related vulnerabilities

Recent vulnerabilities recorded for opencode-ai.

How To Fix

Latest published version: 1.19.4 as of 23 Oct 2026

npm install opencode-ai@1.19.4

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.1.10

This is the first release that contains the fix.

npm install opencode-ai@1.1.10

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback