vole
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software:2222/vole.git
A free and open-source forge that lives in your Git repo.
Harden the browser sign-in surface
edf9db6e07e5fd676049abcd41e78790b0953652 · Keenan Nemetz · 13d ago · parent 62b59a76
Harden the browser sign-in surface The passkey ceremonies were the one place an anonymous client could make the instance work, and they answered more than they had to. Sign-in told a stranger whether an account existed, nothing bounded how often a client could ask, an invite token sat in the request path where every access log would keep it, and a session lookup hashed whatever cookie it was handed. Sign-in no longer answers the question. An unknown account, a retired one and an account with no passkey all get an ordinary assertion request naming one credential that will not be found, which is a shape WebAuthn cannot distinguish from a real account. Only finishing the ceremony fails, generically. The ceremonies are rate-limited per address (20 begins a minute, 60 finishes) and per account name (10 begins), and registration per address (5), with 429 and Retry-After past the budget. The in-flight ceremony map is capped at 4096 entries, swept on every put, five-minute TTL, so a client that never finishes one cannot grow it. The key is the configured trusted-proxy header when there is one, the connection otherwise. Enrollment tokens moved into the URL fragment: /invite#<token> is never sent to the server, so it reaches no log of ours and no proxy access log, and no referrer carries it. Links in the old /invite/<token> shape are redirected into the fragment, and the paths this instance does log are redacted. The page itself renders before the token is known, so the account name appears only after the ceremony. CSRF checks no longer parse the request body. JSON endpoints require the X-Vole-CSRF header; form endpoints parse a body that readForm has already bounded with MaxBytesReader, and then compare the field or the header. Logout bounds its body before parsing and answers a client with no session the same way it answers a successful sign-out. Sign-in, registration, enrollment, the account page and the admin invite page are no-store, no-cache and no-referrer. HSTS now follows the transport rather than the passkey feature: a request over TLS, or an https public_url, is an HTTPS instance whether or not browser sign-in is configured. Sessions refuse a cookie that is not the shape this store issues (base64url, at most 64 characters) before hashing or querying it, and the stored User-Agent is cut to 256 bytes. A passkey whose signature counter does not advance is refused at sign-in and recorded as auth.clone-warning. The policy is documented; the trade is that an authenticator with a broken counter needs an admin to remove its passkey. Tests: the limiter's window and per-key budgets, 429 with Retry-After on a real begin, the decoy's shape and its silence about account state, the ceremony cap and its sweep, the JSON endpoints refusing a form CSRF field, HSTS across TLS/proxy/http, no-store on the auth pages, the invite token redacted from a logged server error, the legacy invite redirect, logout refusing an oversized body, the account page's headers, session token shape and User-Agent truncation.
docs/accounts-and-access.md +26
| @@ -64,6 +64,32 @@ one. If the person loses every passkey, an instance admin issues a new link; the | |||
| 64 | 64 | is no password reset to phish. Retiring an account deletes its sessions | |
| 65 | 65 | immediately, and removing a passkey deletes the sessions that passkey created. | |
| 66 | 66 | ||
| 67 | The link carries its token in the URL fragment — `https://forge.example.com/invite#<token>` | ||
| 68 | — so the browser never sends it to the server, a proxy's access log, or the | ||
| 69 | referrer of anything the page loads. Links issued in the older `/invite/<token>` | ||
| 70 | shape still work: Vole redirects them into the fragment, and its own logs redact | ||
| 71 | the old path. | ||
| 72 | |||
| 73 | Sign-in, registration, enrollment and passkey-adding are rate-limited per client | ||
| 74 | address (and per account name for sign-in), and the ceremony store is bounded and | ||
| 75 | expires after five minutes. A client that exceeds a budget gets `429` with | ||
| 76 | `Retry-After` rather than a slower answer. Behind a proxy, set | ||
| 77 | `git_http_client_ip_header` so those budgets follow the real client instead of | ||
| 78 | the proxy. | ||
| 79 | |||
| 80 | An account name is not proof of anything: asking to sign in as an account that | ||
| 81 | does not exist, is retired, or has no passkey gets the same assertion request as | ||
| 82 | a real one. The difference only appears when the ceremony is finished, and the | ||
| 83 | failure is generic. | ||
| 84 | |||
| 85 | A passkey's signature counter must advance. If an assertion arrives with a | ||
| 86 | counter that did not move, two copies of the key probably exist, so the sign-in | ||
| 87 | is refused and the event is recorded in the audit log as | ||
| 88 | `auth.clone-warning`. This can lock out an authenticator with a broken counter | ||
| 89 | until an admin removes the passkey; that is the deliberate trade. Synced | ||
| 90 | passkeys that always report zero are handled by WebAuthn's own rule and do not | ||
| 91 | trigger the refusal. | ||
| 92 | |||
| 67 | 93 | With `open_registration = true`, `/register` creates a new account and its first | |
| 68 | 94 | passkey without an instance admin. Set `open_registration_role` to the | |
| 69 | 95 | instance-wide role those accounts should have; `contribute` is the usual choice | |