Vellum/internal
mithral 6e04e957b8 Rate limit every surface that checks a password
The limiter covered only /api/v1/auth/login. Jellyfin's AuthenticateByName
and Subsonic's authenticate both called auth.Authenticate with no limiting,
so an attacker brute-forced through those instead: the same password, the
same argon2, no ceiling.

The limiter moves from auth.Handlers onto *Authenticator, which all three
surfaces already hold, so they share one budget and splitting guesses
across surfaces gains nothing. main.go builds one authenticator and hands
it to both compat layers, so the sharing is real rather than intended.

Subsonic needs care: it has no login step, authenticate runs on every
request, so a naive check would charge playback against the login budget
and lock a listener out mid-album. The limiter is consulted only when a
credential was actually supplied, and a success or an uncredentialed
request spends nothing.

Verified red-green on all three: removing the Jellyfin gate fails
TestAuthenticateByNameIsRateLimited with 401 instead of 429; removing the
Subsonic credential guard fails
TestSuccessAndUncredentialedDoNotConsumeTheBudget; neutering AllowLogin or
ResetLogin fails the auth tests.

Known gap, unchanged: the limiter is in-process, so it resets on restart
and does not span replicas. Fine for one binary against one SQLite file.
2026-10-12 00:57:56 -04:00
..
apitoken Waves 9-10: Jellyfin and Subsonic clients can browse and play 2026-10-11 15:05:43 -04:00
arch Guard the storage seam against erosion 2026-10-12 00:06:01 -04:00
auth Rate limit every surface that checks a password 2026-10-12 00:57:56 -04:00
catalog Phase 3: a storage seam behind catalog, and one consumer threaded onto it 2026-10-11 16:16:07 -04:00
cli Documentation, and make a fresh clone actually work 2026-10-12 00:18:11 -04:00
core Make the login limiter correct behind a reverse proxy 2026-10-12 00:45:27 -04:00
engine Waves 7-8: playback engine selection, and missing files you can see 2026-10-11 14:36:55 -04:00
home Phase 2: split the fat packages along real boundaries 2026-10-11 16:03:10 -04:00
httpapi Documentation, and make a fresh clone actually work 2026-10-12 00:18:11 -04:00
httpx Phase 1: accounts, sessions, per-library grants 2026-10-09 16:31:24 -04:00
jellyfin Rate limit every surface that checks a password 2026-10-12 00:57:56 -04:00
jobs Wave 1: survive a real library 2026-10-11 13:10:34 -04:00
library Phase 2: split the fat packages along real boundaries 2026-10-11 16:03:10 -04:00
media Phase 2: split the fat packages along real boundaries 2026-10-11 16:03:10 -04:00
metadata Phase 2: split the fat packages along real boundaries 2026-10-11 16:03:10 -04:00
modules Phase 1: one item-access seam, and architecture rules that fail the build 2026-10-11 15:47:18 -04:00
natsort Phase 6a: directory grouping, audiobooks and music playback 2026-10-09 21:20:47 -04:00
playback Phase 3: a storage seam behind catalog, and one consumer threaded onto it 2026-10-11 16:16:07 -04:00
probe Waves 4-6: audio depth, ffprobe facts, and direct-play video 2026-10-11 14:14:32 -04:00
progress Wave 1: survive a real library 2026-10-11 13:10:34 -04:00
providers Phase 2: split the fat packages along real boundaries 2026-10-11 16:03:10 -04:00
scanner Phase 2: split the fat packages along real boundaries 2026-10-11 16:03:10 -04:00
search Wave 3: search depth, transfer size, and the Home screen's tests 2026-10-11 13:46:18 -04:00
stream Waves 4-6: audio depth, ffprobe facts, and direct-play video 2026-10-11 14:14:32 -04:00
subsonic Rate limit every surface that checks a password 2026-10-12 00:57:56 -04:00