The external UI fallback forwards the local server's Authorization and Cookie headers to app.opencode.ai. Its Fetch client also follows upstream redirects server-side, potentially reaching a different origin.
Strip those local credentials before the UI request, use manual redirect handling for this request, and build the destination by assigning only a pathname on the fixed UI URL. Workspace proxy authentication is unaffected. Redirect responses are returned to the browser rather than followed by the server.
Validation with pinned, officially verified Bun 1.3.14:
- Full frozen installation with lifecycle scripts disabled passes; manifests, lockfile, all existing dependency patches and release-age policy are unchanged.
- Package bun typecheck passes.
- All 15 focused UI/authentication tests pass, including existing Basic/token authentication behavior.
- New regressions fail on the original credential-forwarding behavior and on automatic redirect traversal. The redirect test uses two scoped local Effect Node HTTP servers and real Fetch redirect behavior; the second origin receives zero requests after the fix.
- Authority-like URL helper inputs remain on the trusted origin. The current request adapter already normalizes double-slash paths, so this helper change is defense in depth, not a demonstrated remote request exploit through that adapter.
- Changed-file Prettier and git diff checks pass; scoped Oxlint reports zero errors and one warning on an unchanged generated-module cast.
Draft scope: this is a confirmed credential-forwarding fix and proxy-boundary hardening found during source review. The connector cannot read CodeQL alert locations, so no mapping or closure is claimed for alerts anomalyco#7/anomalyco#8 or the other 30 findings. Intentional permission-controlled shell tools were not blindly restricted. Full application/native packaging and the full test suite were not run. No secret values were read or validated, no alerts were dismissed, and no merge/deployment/upstream change occurred.
AI assistance: prepared with Codex in ChatGPT Work Mode. Independent reviews used GPT-6.1 Sol with low reasoning. The primary session's exact model identifier is not exposed.
Summary by cubic
Fixes the external UI fallback leaking local credentials and following upstream redirects server-side.
The UI proxy no longer forwards the local server's Authorization and Cookie headers to app.opencode.ai, redirect responses are returned to the browser instead of being followed by the server, and destination URLs are built with a pathname assignment so authority-like paths stay on the trusted origin. Workspace proxy authentication is unaffected.
Written for commit 54f0321. Summary will update on new commits.
