Skip to content

fix(webui): refuse to expose training controls without auth - #337

Merged
Yifan Yang (Yif-Yang) merged 1 commit into
mainfrom
security/webui-require-auth-when-exposed
Oct 29, 2026
Merged

Yifan Yang (Yif-Yang) merged 1 commit into
mainfrom
security/webui-require-auth-when-exposed

Conversation

@Yif-Yang

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #249. With --host 0.0.0.0 (or any non-loopback host) or --share and no credentials, the WebUI only printed a warning and then served unauthenticated, so any reachable client could launch training jobs that run with the API keys from .env/.secrets, or stop running ones.

  • main() now exits unless --auth-user/--auth-pass (or SKILLOPT_WEBUI_USER/SKILLOPT_WEBUI_PASS) are set when exposed
  • --allow-unauthenticated keeps the old behaviour as an explicit opt-in
  • Loopback default (no auth) is unchanged
  • Docs updated; also fixes docs/guide/first-experiment.md, which still said the default host is 0.0.0.0

Test plan

  • pytest tests/test_webui_security.py tests/test_webui_build_gradio.py tests/test_webui_env_preflight.py — 103 passed, 2 skipped (new tests: exposed without auth refuses for host and share; exposed with auth launches)

🤖 Generated with Claude Code

Binding a non-loopback --host or using --share without credentials only
printed a warning and then served the UI unauthenticated, letting any reachable
client launch training jobs that run with the API keys from .env/.secrets or
stop running ones.

Now main() exits unless --auth-user/--auth-pass (or SKILLOPT_WEBUI_USER/PASS)
are set; --allow-unauthenticated keeps the old behaviour as an explicit opt-in.
Also fixes first-experiment.md, which still said the default host is 0.0.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Yif-Yang
Yifan Yang (Yif-Yang) merged commit 9f1969b into main Oct 29, 2026
13 checks passed
@Yif-Yang
Yifan Yang (Yif-Yang) deleted the security/webui-require-auth-when-exposed branch October 29, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant