Datadog discloses OpenCode remote code execution vulnerability GHSA-632h-h47v-g4x4(original, opens in a new tab)
Datadog Security Labs disclosed a remote code execution vulnerability GHSA-632h-h47v-g4x4 in the open-source AI coding agent OpenCode, fixed in OpenCode 1.18.22. The root cause is content type confusion in the /global/upgrade endpoint: the endpoint parses the request body as JSON without validating the Content-Type, and the upgrade target is not restricted to semantic versions, allowing attackers to have npm, pnpm, or Bun install a malicious tarball from an arbitrary URL and execute code via preinstall scripts. An attacker uses an HTML form with enctype text/plain to construct a legitimate request body, bypassing CORS and Local Network Access restrictions via top-level navigation, reaching the local 127.0.0.1:4096 service when the victim visits a malicious webpage. Anomaly chose not to apply for a CVE for this vulnerability.