vole
Clone
Read only, no credentials:
https://rodent.software/git/vole.git
Write over SSH with a registered key:
git clone ssh://git@0.0.0.0:2222/vole.git
A free and open-source forge that lives in your Git repo.
Harden the browser sign-in surface
edf9db6e07e5fd676049abcd41e78790b0953652 · Keenan Nemetz · 12d 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.
server/web/templates/auth.html +6−14
| @@ -48,11 +48,12 @@ | |||
| 48 | 48 | ||
| 49 | 49 | {{define "invite"}} | |
| 50 | 50 | {{template "header" .}} | |
| 51 | {{if and .Account .Enabled .Token}} | ||
| 52 | <form class="auth" data-auth="invite" data-token="{{.Token}}"> | ||
| 51 | {{if .Enabled}} | ||
| 52 | <form class="auth" data-auth="invite"> | ||
| 53 | 53 | <div class="card form-card"> | |
| 54 | <h1>Join {{.Account.Name}}</h1> | ||
| 55 | <p class="muted">Register this device as a passkey for <strong>{{.Account.Name}}</strong>. The link works once.</p> | ||
| 54 | <h1>Enrollment link</h1> | ||
| 55 | <p class="muted">Register this device as a passkey for the account this link belongs to. | ||
| 56 | The link works once. The account name appears once the passkey is created.</p> | ||
| 56 | 57 | <p class="error" data-auth-error></p> | |
| 57 | 58 | </div> | |
| 58 | 59 | <div class="form-actions"><button type="submit">Create a passkey</button></div> | |
| @@ -60,17 +61,8 @@ | |||
| 60 | 61 | {{else}} | |
| 61 | 62 | <div class="auth"> | |
| 62 | 63 | <div class="card"> | |
| 63 | {{if .Account}} | ||
| 64 | <h1>Join {{.Account.Name}}</h1> | ||
| 65 | {{if not .Enabled}} | ||
| 66 | <p class="muted">{{.Reason}}</p> | ||
| 67 | {{else}} | ||
| 68 | <p class="error">This enrollment link is no longer valid.</p> | ||
| 69 | {{end}} | ||
| 70 | {{else}} | ||
| 71 | 64 | <h1>Enrollment link</h1> | |
| 72 | <p class="error">This enrollment link is invalid or has expired. Ask an instance admin for a new one.</p> | ||
| 73 | {{end}} | ||
| 65 | <p class="muted">{{.Reason}}</p> | ||
| 74 | 66 | </div> | |
| 75 | 67 | </div> | |
| 76 | 68 | {{end}} | |