
CVE-2026-22812
Security advisory, technical analysis, detection guidance, and mitigation notes for CVE-2026-22812
CVE-2026-22812 is a high-severity Remote Code Execution (RCE) vulnerability affecting OpenCode versions prior to 1.0.216.
The issue exists because OpenCode automatically starts an unauthenticated local HTTP server that can be accessed by:
This allows attackers to execute arbitrary shell commands with the privileges of the current user
Source: NVD / GitHub Advisory
The vulnerable versions automatically expose a localhost HTTP service without authentication.
Because the service also accepts requests from permissive cross-origin sources, any malicious webpage can trigger requests such as:
POST /session/:id/shell
This can lead to:
Successful exploitation may result in:
.env, SSH, API tokens)
Vulnerable: < 1.0.216
Safe: >= 1.0.216
Upgrade immediately:
npm update opencode
or install a safe version:
npm install [email protected]
If upgrading is not immediately possible:
Indicators of possible exploitation:
Recommended telemetry:
⚠️ Public exploitation details exist in advisory discussions.
For responsible disclosure and safety, avoid publishing weaponized PoCs in public production repositories.
This repository is intended for:
Do not use this information on systems you do not own or have permission to test.
| Metric | Value |
|---|
| CVE ID | CVE-2026-22812 |
| Severity | High |
| CVSS | 8.8 |
| CWE | CWE-306, CWE-749, CWE-942 |
| Attack Type | Remote Code Execution |
| Fixed Version | 1.0.216+ |