Skip to content
AgentProv

2026-09-24 · 2026-Q3

OpenCode Drive-By RCE: Any Website Could Make the Local Server Install an Attacker's npm Package (GHSA-632h-h47v-g4x4)

Primary layerL6 Identity / RunSecondary:L4 Code / Package

Which agent, run, or tenant is this?

The question layer 6 asks, and failed here.
Fixable
Vendor patch
Vendor response
Patched
In the wild
No
Actor
Attacker

Target

OpenCode, the open-source AI coding agent, versions 1.14.30 through 1.18.21 installed via npm, pnpm, or Bun

Impact

Datadog Security Labs disclosed on September 24, 2026 that OpenCode's local `/global/upgrade` endpoint accepted a cross-origin POST from an ordinary HTML form. Sent as `text/plain` to slip past JSON validation, the request could specify an arbitrary npm package URL whose preinstall script then ran on the developer's machine, so visiting a malicious page was enough when the server was unauthenticated or browser credentials were cached. The 82 vulnerable versions were downloaded more than 647,000 times between September 17 and 23, 38.9% of all OpenCode downloads that week. Reported August 11, fixed in 1.18.22 on August 24; no CVE at the vendor's request

Root cause

A privileged local agent API that trusted any request reaching localhost, with content-type confusion bypassing the only input check, and an upgrade path that runs install scripts from a caller-supplied package

Sources

Catalog

Cite this: AgentProv incident record: OpenCode Drive-By RCE: Any Website Could Make the Local Server Install an Attacker's npm Package (GHSA-632h-h47v-g4x4) (2026-09-24). https://agentprov.com/incidents/2026-09-24-opencode-drive-by-rce-any-website-could-make-the-local-server-install-an