chore(deps): update dependency opencode-ai to v1.1.10 [security]#12
Merged
chore(deps): update dependency opencode-ai to v1.1.10 [security]#12
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.1.4→1.1.10Malicious website can execute commands on the local system through XSS in the OpenCode web UI
CVE-2026-22813 / GHSA-c83v-7274-4vgp
More information
Details
Summary
A malicious website can abuse the server URL override feature of the OpenCode web UI to achieve cross-site scripting on
http://localhost:4096. From there, it is possible to run arbitrary commands on the local system using the/pty/endpoints provided by the OpenCode API.Code execution via OpenCode API
/pty/endpoints that allow spawning arbitrary processes on the local machine.opencodein your terminal, OpenCode automatically starts an HTTP server onlocalhost:4096that exposes the API along with a web interface.fetch()requests to the/pty/API endpoints. Therefore, JavaScript execution onhttp://localhost:4096gets you code execution on local the machine.JavaScript execution on localhost:4096
The markdown renderer used for LLM responses will insert arbitrary HTML into the DOM. There is no sanitization with DOMPurify or even a CSP on the web interface to prevent JavaScript execution via HTML injection.
This means controlling the LLM response for a chat session gets you JavaScript execution on the
http://localhost:4096origin. This alone would not be enough for a 1-click exploit, but there's functionality inpackages/app/src/app.tsxto allow specifying a custom server URL in a?url=...parameter:Using this custom server URL functionality, you can make the web UI connect to and load chat sessions from an OpenCode instance on another URL. For example, tricking a user into opening http://localhost:4096/Lw/session/ses_45d2d9723ffeHN2DLrTYMz4mHn?url=https://opencode.attacker.example in their browser would load and display
ses_45d2d9723ffeHN2DLrTYMz4mHnfrom the attacker-controlled server at https://opencode.attacker.example.Note on exploitability
Because the localhost web UI proxies static resources from a remote location, the OpenCode team was able to prevent exploitation of this issue by making a server-side change to no longer respect the
?url=parameter. This means the specific vulnerability used to achieve XSS on the localhost web UI no longer works as ofFri, 09 Jan 2026 21:36:31 GMT. Users are still strongly encouraged to upgrade to version 1.1.10 or later, as this disables the web UI/OpenCode API to reduce the attack surface of the application. Any future XSS vulnerabilities in the web UI would still impact users on OpenCode versions before 1.10.0.Proof of Concept
A simple way to serve a malicious chat session is by setting up mitmproxy in front of a real OpenCode instance. This is necessary because the OpenCode web UI must load a bunch of resources before it loads and displays the chat session.
plugin.pywith the contents belowVisit the following URL in a browser on the same machine running OpenCode: http://localhost:4096/Lw/session/ses_45d2d9723ffeHN2DLrTYMz4mHn?url=http://localhost:12345
Confirm the file
albert-was-here.txtwas created in the/tmp/directorySeverity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.