OpenCode
OpenCode's Unauthenticated HTTP Server Allows Arbitrary Command Execution
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 1.0.216
Fixed in 1.0.216
Mitigation
Upgrade opencode to 1.0.216 or later.
References
- Vendor advisory github.com/anomalyco/opencode/security/advisor…
Timeline
Days relative to CVE publicationFirst public PoC 3.5 days after publication; not in CISA KEV. First PoC: Udyz/CVE-2026-22812-Exp (created 16 Jan 2026, found by us: backfilled).
PoC repositories
Found on GitHub.8 PoCs · 1 pending · 2 informational
PoCs 8
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| Udyz/CVE-2026-22812-Exp | 16 Jan 2026 +3.5 d | 1 | PoC |
| rohmatariow/CVE-2026-22812-exploit | 16 Jan 2026 +3.6 d | 34 | PoC |
| mad12wader/CVE-2026-22812 | 18 Jan 2026 +5.4 d | 0 | Scanner |
| 0xgh057r3c0n/CVE-2026-22812 | 19 Jan 2026 +6.9 d | 2 | PoC |
| CayberMods/CVE-2026-22812-POC | 20 Jan 2026 +7.6 d | 1 | PoC |
| 0xBlackash/CVE-2026-22812 | 6 Apr 2026 +83 d | 1 | PoC |
| 0xredash/CVE-2026-22812 | 6 Apr 2026 +83 d | 1 | PoC |
| ashrafzaryouh/CVE-2026-22812 | 6 Apr 2026 +83 d | 1 | PoC |
Pending 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| barrersoftware/opencode-secure | 19 Jan 2026 +6.3 d | 6 | Pending · repository exceeds size limit |
Informational 2
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| HodgeLuke/ai-agent-security-research | 29 Mar 2026 +76 d | 1 | Informational · detection |
| Hex-Neo/CVE-2026-22812-OpenCode-RCE-exp | 27 Apr 2026 +104 d | 1 | Informational · write-up |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.
Other public exploits
Exploit-DB, Metasploit and nuclei count as public PoCs. Exploit-tagged references from the CVE record and NVD are links only. None of these are analysed by us.| Source | Title | Published | Found by us |
|---|---|---|---|
| nuclei template | nuclei template: OpenCode < 1.0.216 - Unauthenticated Remote Code Execution | 27 Jan 2026 | 14 Nov 2026 |
PoC characteristics
What to hunt for in your logs · from 8 PoC reposPOST /session
- Key headers
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7Accept-Language: en-US;q=0.6,en;q=0.5,zh-CN;q=0.4,zh;q=0.3,fa;q=0.2Cache-Control: no-cachePragma: no-cacheUpgrade-Insecure-Requests: 1- Body markers
"agent":"build""command""test":"scanner"inapplication/json- Ports
- 4096, 8080
- PoC User-Agent
Mozilla/5.0 (OpenCode/CVE-2026-22812-Exp)Mozilla/5.0 (X11; Linux x86_64)- Seen in
- 8 repos: 0xBlackash/CVE-2026-22812, 0xgh057r3c0n/CVE-2026-22812, 0xredash/CVE-2026-22812, CayberMods/CVE-2026-22812-POC, Udyz/CVE-2026-22812-Exp, ashrafzaryouh/CVE-2026-22812, mad12wader/CVE-2026-22812, rohmatariow/CVE-2026-22812-exploit
- Evidence
- 0xBlackash/CVE-2026-22812/CVE-2026-22812.py:93 0xBlackash/CVE-2026-22812/CVE-2026-22812.py:114 0xBlackash/CVE-2026-22812/CVE-2026-22812.py:140 0xBlackash/CVE-2026-22812/CVE-2026-22812.yaml:35 0xgh057r3c0n/CVE-2026-22812/CVE-2026-22812.py:93 0xgh057r3c0n/CVE-2026-22812/CVE-2026-22812.py:114
POST /session/{var}/shell
- Key headers
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7Accept-Language: en-US;q=0.6,en;q=0.5,zh-CN;q=0.4,zh;q=0.3,fa;q=0.2Cache-Control: no-cachePragma: no-cacheUpgrade-Insecure-Requests: 1- Body markers
"agent":"build""command":"echo CVE202622812VULN""command""command":"touch /tmp/grass""command":"id"inapplication/json- Ports
- 4096, 8080
- PoC User-Agent
Mozilla/5.0 (OpenCode/CVE-2026-22812-Exp)Mozilla/5.0 (X11; Linux x86_64)- Seen in
- 7 repos: 0xBlackash/CVE-2026-22812, 0xgh057r3c0n/CVE-2026-22812, 0xredash/CVE-2026-22812, CayberMods/CVE-2026-22812-POC, Udyz/CVE-2026-22812-Exp, ashrafzaryouh/CVE-2026-22812, mad12wader/CVE-2026-22812
- Evidence
- 0xBlackash/CVE-2026-22812/CVE-2026-22812.yaml:42 0xgh057r3c0n/CVE-2026-22812/CVE-2026-22812.yaml:42 0xredash/CVE-2026-22812/CVE-2026-22812.yaml:42 CayberMods/CVE-2026-22812-POC/rce.py:58 Udyz/CVE-2026-22812-Exp/CVE-2026-22812.py:30 ashrafzaryouh/CVE-2026-22812/CVE-2026-22812.yaml:42
GET /file/content
- Query
path=/etc/hostnamepath=- Ports
- 4096, 8080
- Seen in
- 5 repos: 0xBlackash/CVE-2026-22812, 0xgh057r3c0n/CVE-2026-22812, 0xredash/CVE-2026-22812, CayberMods/CVE-2026-22812-POC, ashrafzaryouh/CVE-2026-22812
- Evidence
- 0xBlackash/CVE-2026-22812/CVE-2026-22812.yaml:56 0xgh057r3c0n/CVE-2026-22812/CVE-2026-22812.yaml:56 0xredash/CVE-2026-22812/CVE-2026-22812.yaml:56 CayberMods/CVE-2026-22812-POC/rce.py:71 ashrafzaryouh/CVE-2026-22812/CVE-2026-22812.yaml:56
GET /session
- Query
path=- Ports
- 4096, 8080
- Seen in
- 5 repos: 0xBlackash/CVE-2026-22812, 0xgh057r3c0n/CVE-2026-22812, 0xredash/CVE-2026-22812, ashrafzaryouh/CVE-2026-22812, rohmatariow/CVE-2026-22812-exploit
- Evidence
- 0xBlackash/CVE-2026-22812/CVE-2026-22812.py:168 0xgh057r3c0n/CVE-2026-22812/CVE-2026-22812.py:168 0xredash/CVE-2026-22812/CVE-2026-22812.py:168 ashrafzaryouh/CVE-2026-22812/CVE-2026-22812.py:168 rohmatariow/CVE-2026-22812-exploit/exploit.py:211
POST /pty
- Content-Type
application/json- Ports
- 4096, 8080
- Seen in
- 4 repos: 0xBlackash/CVE-2026-22812, 0xgh057r3c0n/CVE-2026-22812, 0xredash/CVE-2026-22812, ashrafzaryouh/CVE-2026-22812
- Evidence
- 0xBlackash/CVE-2026-22812/CVE-2026-22812.yaml:49 0xgh057r3c0n/CVE-2026-22812/CVE-2026-22812.yaml:49 0xredash/CVE-2026-22812/CVE-2026-22812.yaml:49 ashrafzaryouh/CVE-2026-22812/CVE-2026-22812.yaml:49
POST /session/"id"/shell
- Body markers
"agent":"build""command":"id"inapplication/json- PoC User-Agent
Mozilla/5.0 (X11; Linux x86_64)- Seen in
- 1 repo: mad12wader/CVE-2026-22812
- Evidence
- mad12wader/CVE-2026-22812/README.md:18
Regex
Generated from PoC characteristics; not yet reviewed. Matches the request path and query.
(?i)^/session(?:[?#].*)?$
(?i)^/session/[^/?#]*/shell(?:[?#].*)?$
(?i)^/file/content\?(?:.*&)?path=/etc/hostname.*path=
(?i)^/session\?(?:.*&)?path=
(?i)^/pty(?:[?#].*)?$
Suricata
Template generated from PoC characteristics. Review before deploying.
alert http any any -> $HOME_NET [4096,8080] (msg:"GG PoC-Monitor CVE-2026-22812 anomalyco opencode exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/session"; http.header; content:"Accept: text/html,application/xhtml+xml,application/xml|3b|q=0.9,image/avif,image/webp,image/apng,*/*|3b|q=0.8,application/signed-exchange|3b|v=b3|3b|q=0.7"; nocase; http.header; content:"Accept-Language: en-US|3b|q=0.6,en|3b|q=0.5,zh-CN|3b|q=0.4,zh|3b|q=0.3,fa|3b|q=0.2"; nocase; http.header; content:"Cache-Control: no-cache"; nocase; http.header; content:"Pragma: no-cache"; nocase; http.header; content:"Upgrade-Insecure-Requests: 1"; nocase; http.request_body; content:"|22|agent|22|:|22|build|22|"; http.request_body; content:"|22|command|22|"; http.request_body; content:"|22|test|22|:|22|scanner|22|"; reference:url,poc.griffinguard.io/cve/CVE-2026-22812; classtype:web-application-attack; sid:9123575; rev:1;)
alert http any any -> $HOME_NET [4096,8080] (msg:"GG PoC-Monitor CVE-2026-22812 anomalyco opencode exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/session/"; http.uri; content:"/shell"; http.header; content:"Accept: text/html,application/xhtml+xml,application/xml|3b|q=0.9,image/avif,image/webp,image/apng,*/*|3b|q=0.8,application/signed-exchange|3b|v=b3|3b|q=0.7"; nocase; http.header; content:"Accept-Language: en-US|3b|q=0.6,en|3b|q=0.5,zh-CN|3b|q=0.4,zh|3b|q=0.3,fa|3b|q=0.2"; nocase; http.header; content:"Cache-Control: no-cache"; nocase; http.header; content:"Pragma: no-cache"; nocase; http.header; content:"Upgrade-Insecure-Requests: 1"; nocase; http.request_body; content:"|22|agent|22|:|22|build|22|"; http.request_body; content:"|22|command|22|:|22|echo CVE202622812VULN|22|"; http.request_body; content:"|22|command|22|"; http.request_body; content:"|22|command|22|:|22|touch /tmp/grass|22|"; http.request_body; content:"|22|command|22|:|22|id|22|"; reference:url,poc.griffinguard.io/cve/CVE-2026-22812; classtype:web-application-attack; sid:9258488; rev:1;)
alert http any any -> $HOME_NET [4096,8080] (msg:"GG PoC-Monitor CVE-2026-22812 anomalyco opencode exploit attempt"; flow:established,to_server; http.method; content:"GET"; http.uri; content:"/file/content"; http.uri; content:"path=/etc/hostname"; http.uri; content:"path="; reference:url,poc.griffinguard.io/cve/CVE-2026-22812; classtype:web-application-attack; sid:9288175; rev:1;)
alert http any any -> $HOME_NET [4096,8080] (msg:"GG PoC-Monitor CVE-2026-22812 anomalyco opencode exploit attempt"; flow:established,to_server; http.method; content:"GET"; http.uri; content:"/session"; http.uri; content:"path="; reference:url,poc.griffinguard.io/cve/CVE-2026-22812; classtype:web-application-attack; sid:9501925; rev:1;)
alert http any any -> $HOME_NET [4096,8080] (msg:"GG PoC-Monitor CVE-2026-22812 anomalyco opencode exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/pty"; reference:url,poc.griffinguard.io/cve/CVE-2026-22812; classtype:web-application-attack; sid:9311880; rev:1;)
Sigma
Template generated from PoC characteristics. Review before deploying.
title: anomalyco opencode exploit attempt (CVE-2026-22812)
id: gg-pocmon-cve-2026-22812-9123575
status: experimental
description: Request pattern taken from public PoCs for CVE-2026-22812. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2026-22812
logsource:
category: webserver
detection:
selection:
cs-method: POST
cs-uri-stem|contains|all:
- '/session'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: high
tags:
- attack.initial_access
- attack.t1190
- cve.2026.22812
title: anomalyco opencode exploit attempt (CVE-2026-22812)
id: gg-pocmon-cve-2026-22812-9258488
status: experimental
description: Request pattern taken from public PoCs for CVE-2026-22812. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2026-22812
logsource:
category: webserver
detection:
selection:
cs-method: POST
cs-uri-stem|contains|all:
- '/session/'
- '/shell'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: high
tags:
- attack.initial_access
- attack.t1190
- cve.2026.22812
title: anomalyco opencode exploit attempt (CVE-2026-22812)
id: gg-pocmon-cve-2026-22812-9288175
status: experimental
description: Request pattern taken from public PoCs for CVE-2026-22812. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2026-22812
logsource:
category: webserver
detection:
selection:
cs-method: GET
cs-uri-stem|contains|all:
- '/file/content'
cs-uri-query|contains|all:
- 'path=/etc/hostname'
- 'path='
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: high
tags:
- attack.initial_access
- attack.t1190
- cve.2026.22812
title: anomalyco opencode exploit attempt (CVE-2026-22812)
id: gg-pocmon-cve-2026-22812-9501925
status: experimental
description: Request pattern taken from public PoCs for CVE-2026-22812. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2026-22812
logsource:
category: webserver
detection:
selection:
cs-method: GET
cs-uri-stem|contains|all:
- '/session'
cs-uri-query|contains|all:
- 'path='
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: high
tags:
- attack.initial_access
- attack.t1190
- cve.2026.22812
title: anomalyco opencode exploit attempt (CVE-2026-22812)
id: gg-pocmon-cve-2026-22812-9311880
status: experimental
description: Request pattern taken from public PoCs for CVE-2026-22812. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2026-22812
logsource:
category: webserver
detection:
selection:
cs-method: POST
cs-uri-stem|contains|all:
- '/pty'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: high
tags:
- attack.initial_access
- attack.t1190
- cve.2026.22812