Unauthenticated remote code execution in OpenCode
The OpenCode server, when enabled, could be reached without authentication and allowed remote code execution. An attacker could exploit it, including via a malicious page visited while the server runs.
cy.md
Published on cy.md
The original lives on cy.md
We do not hold its text, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the server was enabled by default or by configuration and lacked authentication, so any local or reachable client could invoke privileged functionality.
Impact
An attacker could run code on the victim's machine without authentication when the server is enabled; the advisory notes that visiting opencode.ai or its subdomains while the server runs is dangerous.
What the attacker needed
Server enabled via config or flag; attacker can reach the local server
The fix
It was fixed in v1.1.10, which disables the server by default; users should also avoid the --mdns flag and check config for server settings.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
OpenCode is a tool that can run a small web server on your computer. If that server is switched on, other software or websites could talk to it without proving who they are, and the report says they could run their own code on your machine. The fix is to update so the server stays off unless you deliberately turn it on.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.