CVE-2026-22812: Unauthenticated Command Execution in OpenCode Local HTTP Server
- Vendor
- Anoma
OpenCode versions prior to 1.0.216 automatically start a local HTTP server without authentication, exposing functionality for arbitrary shell command execution and file reads. Permissive cross-origin resource sharing allows malicious websites to invoke these functions through a visitor's browser, with exploitation confirmed in Firefox. Local processes can also invoke the exposed functions directly. Commands execute with the privileges of the user running OpenCode. Starting OpenCode with multicast DNS enabled can extend server exposure to the local network.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation compromises the confidentiality, integrity, and availability of resources accessible to the user running OpenCode. Attackers can execute arbitrary commands, read sensitive files and credentials, modify or delete user-accessible data, and disrupt applications. The vulnerability does not inherently grant privileges beyond those of the OpenCode process.
Mitigation
If you can’t patch tonight, do this now.
Until upgrading, stop OpenCode or disable the component that automatically starts its HTTP server where possible. Avoid browsing untrusted websites while vulnerable OpenCode instances are running. Do not use the --mdns flag, which can bind the server to all network interfaces and advertise it through Bonjour. Restrict listening interfaces to loopback and use a host firewall to block inbound access to OpenCode's ports, beginning at port 4096. Loopback binding alone does not prevent exploitation by local processes or malicious websites through a susceptible browser. Avoid executing untrusted local code while OpenCode is running.
Remediation
Patch, then assume compromise.
Upgrade OpenCode, distributed through the opencode-ai npm package, to version 1.0.216 or later. Ensure the HTTP server requires authentication before exposing command-execution or file-access functionality.
Exploits
6 exploits validated by Mallory's analysis. Hidden: 3 rejected by Mallory's analysis as not a working exploit; 1 not yet analyzed, such as Exploit-DB entries.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Frequently asked questions
- Is CVE-2026-22812 exploited in the wild?
- As of Oct 27, 2026, Mallory has no reports of CVE-2026-22812 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2026-22812?
- Yes. Mallory tracks 6 public exploits or proofs of concept for CVE-2026-22812, the earliest disclosed Jan 16, 2026.
- Is there a patch for CVE-2026-22812?
- Upgrade OpenCode, distributed through the opencode-ai npm package, to version 1.0.216 or later. Ensure the HTTP server requires authentication before exposing command-execution or file-access functionality.
- What products are affected by CVE-2026-22812?
- Anoma Opencode.
- How severe is CVE-2026-22812?
- CVE-2026-22812 has a CVSS v3.1 score of 8.8 (High) and an EPSS score of 2.3% (84th percentile) as of Oct 27, 2026.
Recent activity
23 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.