You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
serve: require explicit confirmation when binding non-loopback without OPENCODE_SERVER_PASSWORD #10948
opencode serve starts a headless API server. If OPENCODE_SERVER_PASSWORD is not set, the server runs unauthenticated (it only prints a warning).
When users bind to a non-loopback hostname (e.g. --hostname 0.0.0.0 or --mdns which defaults hostname to 0.0.0.0), this can easily expose the server (and agent capabilities) to a LAN/public network by accident.
Suggested fix
If hostname is non-loopback and OPENCODE_SERVER_PASSWORD is unset:
On TTY: prompt for confirmation (default No) before starting.
On non-TTY: refuse to start unless the user explicitly opts in (e.g. --yes).
This keeps loopback behavior unchanged and avoids hanging in non-interactive environments.
Steps to reproduce
Ensure OPENCODE_SERVER_PASSWORD is unset.
Run opencode serve --hostname 0.0.0.0 (or opencode serve --mdns).
Observe it starts unauthenticated with only a warning.
Thanks — these are related, but this issue is intentionally narrower.
This proposal only changes opencode serve behavior when binding to a non-loopback hostname withoutOPENCODE_SERVER_PASSWORD: require an explicit confirmation (TTY) or --yes (non-TTY) before starting.
It does not introduce new auth mechanisms or auto-generate passwords; it’s a minimal guardrail to reduce accidental exposure, especially with --hostname 0.0.0.0 / --mdns.
Activity
github-actions commentedon Jan 28, 2026
This issue might be a duplicate of existing issues. Please check:
opencode serverapi #5256: Adding Authentication toopencode serverapi (proposes authentication mechanism for remote server instances)Feel free to ignore if none of these address your specific case.
MaxMiksa commentedon Jan 28, 2026
Thanks — these are related, but this issue is intentionally narrower.
This proposal only changes
opencode servebehavior when binding to a non-loopback hostname withoutOPENCODE_SERVER_PASSWORD: require an explicit confirmation (TTY) or--yes(non-TTY) before starting.It does not introduce new auth mechanisms or auto-generate passwords; it’s a minimal guardrail to reduce accidental exposure, especially with
--hostname 0.0.0.0/--mdns.github-actions commentedon Mar 30, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.