WS-2026-0073
Published:September 24, 2026
Updated:September 28, 2026
OpenCode is an open source AI coding agent. In versions 1.14.30 through 1.18.21, the "/global/upgrade" endpoint of the "opencode serve" HTTP server parses a "text/plain" request body as JSON, does not validate the request Origin, and passes an arbitrary package specifier from the "target" field to the npm-compatible package manager. A malicious webpage can submit a cross-site form to the local server and make an npm, pnpm, or Bun managed installation install an attacker-controlled package, executing its lifecycle scripts and leading to remote code execution. This issue has been fixed in version 1.18.22.
Affected Packages
https://github.com/anomalyco/opencode.git (GITHUB):
Affected version(s) >=v1.14.30 <v1.18.22Fix Suggestion:
Update to version v1.18.22opencode-ai (NPM):
Affected version(s) >=1.14.30 <1.18.22Fix Suggestion:
Update to version 1.18.22Related Resources (3)
Do you need more information?
Contact UsCVSS v4
Base Score:
7.7
Attack Vector
NETWORK
Attack Complexity
HIGH
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
PASSIVE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
HIGH
Vulnerable System Availability
HIGH
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
7.5
Attack Vector
NETWORK
Attack Complexity
HIGH
Privileges Required
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Weakness Type (CWE)
Cross-Site Request Forgery (CSRF)