{"answers":{"affected":"2 open source packages ship an affected version, including opencode-ai. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-22812 exists.","fix":"Upgrade opencode-ai to 1.0.216 or later.","what":"CVE-2026-22812 is a high-severity command injection vulnerability in anomalyco opencode, published on 12 Jan 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2026-22812 and fix it if it is affected.\n\nWhat it is: CVE-2026-22812 is a high-severity command injection vulnerability in anomalyco opencode, published on 12 Jan 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-22812 exists.\n\nAffected packages and fixed versions:\n- opencode-ai (npm): affected all versions; fixed in 1.0.216\n- opencode-ai (npm): affected all versions; fixed in 1.0.216\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-22812/ (Markdown: https://insights.sbomify.com/CVE-2026-22812/index.md)","id":"CVE-2026-22812","markdown":"https://insights.sbomify.com/CVE-2026-22812/index.md","name":"CVE-2026-22812","record":{"aliases":["GHSA-vxw4-wv6m-9hhh"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"AI coding agent","requires_auth":"none","summary":"An unauthenticated local HTTP server in OpenCode allows arbitrary shell command execution via permissive CORS, requiring an upgrade to secure the tool.","user_interaction":"required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"opencode","vendor":"anoma"}],"cvss":{"score":8.8,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-942","name":"Permissive Cross-domain Security Policy with Untrusted Domains"},{"id":"CWE-749","name":"Exposed Dangerous Method or Function"},{"id":"CWE-306","name":"Missing Authentication for Critical Functionality"}],"description":"OpenCode is an open source AI coding agent. Prior to 1.0.216, OpenCode automatically starts an unauthenticated HTTP server that allows any local process (or any website via permissive CORS) to execute arbitrary shell commands with the user's privileges. This vulnerability is fixed in 1.0.216.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":"2026-01-16","github_poc":9,"max_poc_stars":34,"metasploit":0,"nuclei":1,"refs":[{"date":"2026-01-16T12:25:16Z","kind":"github_poc","ref":"https://github.com/rohmatariow/CVE-2026-22812-exploit","stars":34,"title":null},{"date":"2026-01-19T04:52:22Z","kind":"github_poc","ref":"https://github.com/barrersoftware/opencode-secure","stars":6,"title":"Security-hardened fork of OpenCode - Fixes CVE-2026-22812 (CVSS 8.8 RCE) that upstream refuses to patch"},{"date":"2026-01-19T21:20:41Z","kind":"github_poc","ref":"https://github.com/0xgh057r3c0n/CVE-2026-22812","stars":2,"title":"OpenCode  \u003c v1.0.216 - Unauthenticated RCE"},{"date":"2026-01-16T11:15:04Z","kind":"github_poc","ref":"https://github.com/Udyz/CVE-2026-22812-Exp","stars":1,"title":"CVE-2026-22812 - OpenCode Unauth RCE"},{"date":"2026-01-20T12:29:32Z","kind":"github_poc","ref":"https://github.com/CayberMods/CVE-2026-22812-POC","stars":1,"title":null},{"date":"2026-03-29T11:19:22Z","kind":"github_poc","ref":"https://github.com/HodgeLuke/ai-agent-security-research","stars":1,"title":"Open security research on AI coding agent infrastructure. Agent-executable remediation manifests for CVE-2026-22812 and CVE-2026-22813."},{"date":"2026-04-06T07:22:53Z","kind":"github_poc","ref":"https://github.com/0xredash/CVE-2026-22812","stars":1,"title":"CVE-2026-22812"},{"date":"2026-04-27T01:38:45Z","kind":"github_poc","ref":"https://github.com/Hex-Neo/CVE-2026-22812-OpenCode-RCE-exp","stars":1,"title":null}],"tier":"weaponised"},"has_fix":true,"headline":"OpenCode's Unauthenticated HTTP Server Allows Arbitrary Command Execution","id":"CVE-2026-22812","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"command_injection","year":"2026"},"n_packages":2,"n_references":1,"next":{"headline":"Malicious website can execute commands on the local system through XSS in the OpenCode web UI","id":"CVE-2026-22813"},"packages":[{"ecosystem":"npm","fixed":["1.0.216"],"introduced":["0"],"last_affected":[],"package":"opencode-ai","purl":null,"source":"GHSA-vxw4-wv6m-9hhh"},{"ecosystem":"npm","fixed":["1.0.216"],"introduced":["0"],"last_affected":[],"package":"opencode-ai","purl":"pkg:npm/opencode-ai","source":"GHSA-vxw4-wv6m-9hhh"}],"prev":{"headline":"Joplin: Path traversal in OneNote importer allows overwriting arbitrary files","id":"CVE-2026-22810"},"products":["opencode"],"published":"2026-01-12","related":[{"cvss_score":9.4,"headline":"Malicious website can execute commands on the local system through XSS in the OpenCode web UI","id":"CVE-2026-22813","kev_date_added":null,"published":"2026-01-12"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-01-13","vendors":["anomalyco"]},"summary":"An unauthenticated local HTTP server in OpenCode allows arbitrary shell command execution via permissive CORS, requiring an upgrade to secure the tool.","url":"https://insights.sbomify.com/CVE-2026-22812/"}