Skip to main content
Mallory
HighPublic exploitVulnerability

CVE-2026-22812: Unauthenticated Command Execution in OpenCode Local HTTP Server

Published Jan 12, 2026 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS8.8High · v3.1
EPSS2.3%84th percentile
CISA KEVNoNot listed
In the wildNonePublic exploit, no exploitation reported
Vendor
Anoma
IdentifiersCVE-2026-22812CWE-306 · Missing Authentication for…

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.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

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.

Public exploits

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.

View more in app →
CVE-2026-22812Repository contains a Python exploit and a Nuclei template targeting CVE-2026-22812 in anomalyco OpenCode versions earlier than 1.0.216. The issue is an unauthenticated HTTP service that exposes command execution and related functionality. The Python script is the primary exploit implementation: it initializes a requests session, checks vulnerability by POSTing to /session, stores the returned session id, and then uses /session/{id}/shell with JSON payloads containing an attacker-controlled command. Based on the visible CLI handling and method names, it supports vulnerability checking, one-shot command execution, interactive shell access, system information gathering, file reading, file upload, and file download. It also supports configurable timeout and HTTP/HTTPS proxying. The YAML file is a Nuclei template that fingerprints the vulnerability by chaining requests to /session, /session/{{session_id}}/shell, /pty, and /file/content?path=/etc/hostname. It extracts the session id from JSON and confirms exploitation by matching the echoed marker string `CVE202622812VULN`, PTY behavior, file-read success, or session creation bypass. Because this repository includes a Nuclei template, it belongs to a framework; however, the repository also includes standalone exploit code. Overall purpose: provide both active exploitation and scanner-based validation for OpenCode's exposed local HTTP API leading to unauthenticated RCE and file access.0xBlackash · Disclosed Apr 6, 2026 · Framework: nuclei · python · yaml · web · browser · localWeaponizedCVE-2026-22812-ExpRepository contains a single Python exploit script (CVE-2026-22812.py) and a minimal README. The script is a network-based RCE PoC/operational exploit that takes a base URL from argv[1], strips a trailing slash, and uses the requests library (TLS verification disabled) to interact with a presumed vulnerable HTTP API. Workflow: 1) POST {BASE_URL}/session with browser-like headers to obtain/trigger a list of sessions. It checks for the substring 'ses_' in the response body and then parses the response as JSON. 2) Iterates over returned session objects, extracting sid['id']. 3) For each session id, POSTs to {BASE_URL}/session/{id}/shell with JSON payload {agent: 'build', command: 'touch /tmp/grass'}. 4) Prints the response; if HTTP 500, it tries the next session; otherwise it reports success and stops. Notable characteristics: hardcoded command payload (creates /tmp/grass), no authentication handling, no target fingerprinting beyond the 'ses_' substring check, and verify=False (susceptible to MITM but common in PoCs).Udyz · Disclosed Jan 16, 2026 · python · networkOperationalCVE-2026-22812-exploitRepository contains a standalone Python exploitation tool for CVE-2026-22812 (OpenCode unauthenticated RCE) targeting OpenCode versions < 1.0.216. Structure is minimal: (1) README.md documents features and usage, (2) exploit.py implements the exploit logic and CLI, (3) requirements.txt pins Python dependencies (requests, urllib3). Core exploit flow in exploit.py: - Establishes an HTTP client (requests.Session) with optional proxy support and TLS verification disabled. - Verifies vulnerability by attempting unauthenticated session creation via POST to the /session endpoint; on success it extracts a returned session id. - Performs RCE by POSTing JSON to /session/{session_id}/shell with fields like {"agent":"build","command":"<attacker command>"}. Capabilities advertised/implemented (per README and visible code portions): - Unauthenticated session creation (used as both a check and prerequisite). - Arbitrary command execution (single command mode and interactive shell mode with readline history). - File operations: read arbitrary files; upload/download files (implementation exists but is truncated in provided content). - System enumeration helper (e.g., hostname/user/kernel/os/ip/process listing) and optional PTY session creation. Primary network targets/endpoints are the OpenCode service base URL (commonly http://<host>:4096) and the REST-style paths /session and /session/{id}/shell. The tool is operational (usable end-to-end) and not merely a detector, as it provides interactive command execution and post-exploitation utilities.rohmatariow · Disclosed Jan 16, 2026 · python · networkOperationalAshwesker-CVE-2026-22812Repository contains a standalone Python proof-of-concept/operational exploit for CVE-2026-22812 (OpenCode unauthenticated HTTP server leading to RCE). Structure: (1) CVE-2026-22812.py is the main exploit tool using requests.Session with TLS verification disabled and optional proxy support. It first creates an unauthenticated session via POST {target}/session and then achieves RCE by POSTing JSON to {target}/session/{id}/shell with fields including agent='build' and an attacker-supplied command. The script supports multiple operator workflows: vulnerability verification, single-command execution, and an interactive shell loop. The truncated portion plus README indicate additional helper features implemented in the script: reading files, uploading/writing files, downloading/exfiltrating files, collecting system information (hostname/user/kernel/os/processes), and creating a PTY session for improved interactivity. (2) README.md documents affected versions (<1.0.216), attack scenario (network reachable local server + permissive CORS enabling browser-assisted attacks), and provides usage examples for verify/command/interactive/file ops/sysinfo. (3) requirements.txt pins requests/urllib3. Overall purpose: provide unauthenticated remote command execution and post-exploitation convenience functions against vulnerable OpenCode instances exposed on an HTTP port (examples use :4096).Ashwesker · Disclosed Jan 17, 2026 · python · networkOperationalCVE-2026-22812Repository contains a Python exploitation tool and a Nuclei template for CVE-2026-22812 (OpenCode < 1.0.216). The core exploit logic (CVE-2026-22812.py) uses unauthenticated HTTP requests to OpenCode’s exposed service to (1) create a session via POST /session and (2) execute arbitrary OS commands via POST /session/{session_id}/shell with a JSON body containing an agent name and command. The README indicates additional capabilities implemented in the Python tool: interactive shell mode, file read/write, upload/download, and system reconnaissance, with optional HTTP proxy support and basic statistics tracking. Structure/purpose: - CVE-2026-22812.py: primary exploit client (requests-based), session creation, command execution, interactive loop, and file operations (per README and visible endpoint usage). - CVE-2026-22812.yaml: Nuclei template to detect/confirm the issue by creating a session, executing a benign echo command, optionally probing /pty, and reading /file/content?path=/etc/hostname. - README.md: usage examples and endpoint documentation. - LICENSE: MIT. Overall, this is an operational unauthenticated RCE exploit client for OpenCode’s exposed HTTP endpoints, plus a scanner template to validate vulnerability and basic exploitation primitives.0xgh057r3c0n · Disclosed Jan 19, 2026 · Framework: nuclei (template included) · python · yaml · network (unauthenticated HTTP RCE via exposed OpenCode endpoints)OperationalCVE-2026-22812-POCRepository contains a Nuclei detection template plus a standalone Python exploit for alleged OpenCode unauthenticated RCE (CVE-2026-22812). Structure: - CVE-2026-22812-detect.yaml: Nuclei template that probes BaseURL and common OpenCode ports (4096-4100) to (1) identify OpenCode via body keywords ("OpenCode"/"opencode-sdk") and (2) confirm unauthenticated session creation by POSTing to /session and matching HTTP 200/201 with a JSON body containing an "id". - rce.py: Main exploit tool. Implements an OpenCodeExploiter class using requests.Session with a distinctive User-Agent. Core flow is POST {url}/session to obtain a session id, then POST {url}/session/{id}/shell with JSON {agent:"build", command:<cmd>} to execute arbitrary commands. Includes a GET {url}/file/content?path=<path> helper to read file contents. The check routine validates the target looks like OpenCode, creates a session, and runs a benign command (echo 'VULN_TEST') to confirm RCE. The script also supports scanning multiple targets concurrently (ThreadPoolExecutor) and printing/saving results. - README.md: Usage examples (check, command execution, file read, list scanning) and notes default ports 4095-4100 and search dorks. Capabilities: - Unauthenticated remote command execution against exposed OpenCode HTTP API. - Unauthenticated file read via file content endpoint. - Target discovery/checking and multi-target scanning with concurrency and optional output. Notes: - The provided rce.py content is truncated in the supplied snapshot, but the visible portions clearly show the exploit primitives (/session, /session/{id}/shell, /file/content) and the vulnerability check logic.CayberMods · Disclosed Jan 20, 2026 · Framework: nuclei (detection template present); standalone python exploit also included · python · yaml · network (unauthenticated HTTP API abuse leading to RCE and file read)Operational
Exposure surface

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.

VendorProductType
AnomaOpencodeapplication
FAQ

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.
Activity feed

Recent activity

23 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
govinfosecurityNews · Oct 26, 2026Securing AI Coding Harnesses - GovInfoSecurityOpenCode exposed an unauthenticated local HTTP server with permissive CORS, allowing a website visited by the developer to execute shell commands on the developer's machine. The article states that the vulnerability was fixed and recommends externally supplied container or virtual-machine isolation for OpenCode.Read more ↗bank info securityNews · Oct 26, 2026Securing AI Coding Harnesses - BankInfoSecurityOpenCode exposed an unauthenticated local HTTP server with permissive CORS, allowing websites visited by a developer to execute shell commands on the developer's machine. The article states that the vulnerability was fixed and recommends organization-supplied container or virtual-machine isolation for OpenCode.Read more ↗nuclei templates pull requestsNews · Apr 25, 2026[Fix] CVE-2026-3535 and CVE-2026-3599 - Harmless Trigger Detection by eyangfeng88-arch · Pull Request #16032 · projectdiscovery/nuclei-templates · GitHubA specific vulnerability referenced in repository commit and template update messages, but no technical details are provided in the content.Read more ↗nuclei templates pull requestsNews · Apr 25, 2026[Fix] 4 CVE Templates - Simplified with Karpathy Principles by eyangfeng88-arch · Pull Request #16034 · projectdiscovery/nuclei-templates · GitHubA specific vulnerability referenced in template creation/correction commits, but no technical details are provided in the content.Read more ↗
+5 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signatures1YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity14Community discussion across Reddit, Mastodon, and other social sources.