No way to log into the web without an SSH key #155

closed cmc opened this on 2026-09-05 03:09 UTC · milestone v1.14.0

Discussion

cmc 2026-09-05 03:09 UTC

CreateWebSession has exactly one caller, internal/httpd/accounts.go:89, the /login?token= handler. The token that reaches it can only be minted by web login over SSH. Web signup requires pasting a public key (internal/httpd/accounts.go:211).

So anyone without an SSH key cannot use the web UI at all. admin user create already makes --key optional, which means an admin can create an account today that has no way to authenticate anywhere.

web.password_auth exists in the config and is rejected at startup (internal/config/config.go:325) as not implemented.

Fix: let an unauthenticated visitor request a login link by username or verified email address, delivered by the SMTP that already sends verification mail.

This does not widen what a browser session can do. The web dispatches with ViaAPI: true, so a session cannot run any SSHOnly command — secrets, token minting, admin, audit, and mirror credentials stay on SSH regardless of how the session was obtained.

Design: docs/specs/2026-09-04-email-login-design.md.

referenced in commit c7a2a1a6ab by cmc: e2e: a link minted before suspension opens nothing

2026-09-05 04:20 UTC

referenced in commit cfc0bc7785 by cmc: web: a suspended account cannot mail itself a session

2026-09-05 04:20 UTC

referenced in commit 3f7a91e284 by cmc: web: close the login-link timing side channel, cover the username path

2026-09-05 04:20 UTC

closed by commit 090dc2eb20 by cmc: web: request a login link by email

2026-09-05 04:20 UTC

referenced in commit 63ec505eda by cmc: httpd: session cookie is SameSite=Lax

2026-09-05 04:20 UTC

referenced in commit 9a58f1933f by cmc: store: count login tokens per account, indexed

2026-09-05 04:20 UTC

referenced in commit cc3550cfbb by cmc: Plan: confirm the user lookup, fix the index check

2026-09-05 04:20 UTC

referenced in commit 965735bfbc by cmc: Plan: browser login without an SSH key

2026-09-05 04:20 UTC

referenced in commit 8c430f898a by cmc: Design: name the store file, specify the empty identifier

2026-09-05 04:20 UTC

referenced in commit b24bfe450b by cmc: Design: browser login without an SSH key

2026-09-05 04:20 UTC