Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

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.

docs/operations.md +12−1

@@ -177,7 +177,9 @@ the linked sections explain each in full.
177 177 `http_addr = "127.0.0.1:8080"`, and put a proxy in front that terminates TLS
178 178 and passes the `Host` header through unchanged. Alternatively set `https_addr`
179 179 with `acme_email` and `acme_domains` and let Vole do it. Set `public_url` to
180 the canonical `https://` address so links and passkeys agree with it. See
180 the canonical `https://` address so links and passkeys agree with it. When the
181 request arrives over TLS, or `public_url` is `https://`, Vole sends HSTS on
182 every response, not only on the pages that use passkeys. See
181 183 [Configuration](configuration.md).
182 184 - **SSH firewalled.** The SSH listener is the only write transport and the only
183 185 place an account is authenticated. Expose it to the people who push, not to the
@@ -193,6 +195,15 @@ the linked sections explain each in full.
193 195 `receive_max_bytes = 1 GiB`, and a 600 s budget for one clone. Raise them with
194 196 measurements, not with optimism; the read path is anonymous, so a limit that is
195 197 too low is a slow clone and a limit that is missing is an outage.
198 - **Bounded sign-in.** The passkey ceremonies are the only anonymous endpoints
199 that cost the instance work, so they are rate-limited per client address
200 (`20` begins a minute), per account name (`10`), and for registrations (`5`),
201 and the in-flight ceremony map is capped at `4096` entries with a five-minute
202 expiry. A refused client gets `429` with `Retry-After`. Behind a proxy, set
203 `git_http_client_ip_header` so the budgets follow the real address. Invite
204 tokens live in the URL fragment, so they never reach an access log; links in
205 the old `/invite/<token>` shape are redirected into it. See
206 [Accounts § Browser sign-in](accounts-and-access.md#browser-sign-in).
196 207 - **Bounded before authentication.** The SSH listener refuses connections past
197 208 `ssh_max_connections` before the handshake and drops a connection that has not
198 209 finished its handshake in `ssh_handshake_timeout_seconds`, so an anonymous