Repository navigation
Description
Where
server/src/auth/routes.ts:35-47—GET /auth/loginis public and callscreateLoginAttempton every hit.server/src/auth/sessions.ts:27-43—LOGIN_ATTEMPTS_MAX = 10_000; at that many live attempts (TTLLOGIN_TTL_MS= 10 min) every new login is refused with/?loginError=1; live attempts are never evicted. No address is stored with an attempt and nothing limits attempts per address (AttemptLimiter/addressKeyfromhttp/attempts.tsare not used here).
What happens
The #255 cap stops the table from growing but turns an anonymous flood into a sign-in outage: one client sending about 17 requests per second (10,000 per TTL window) keeps the table full, and every member of the shard, the admin included, is sent back to the app with the login error. The IdP is never reached, so nothing upstream limits it.
Probe
startTestApp(); 10,000 × GET /auth/login from 203.0.113.77 — all answered 302 to the IdP in 4.9 s; then GET /auth/login?login_hint=testuser from 198.51.100.7 → 302 /?loginError=1; the harness's login(t, 'testuser') fails. server/test/auth.test.ts:160-172 pins this behaviour as intended for a full table, which is why the attacker-driven case was never considered.
Expected
A flood from one address (or one IPv6 /64) cannot stop members on other addresses from signing in. The global cap stays as the last resort for a distributed flood.
Fix
- Rate-limit login starts per
addressKey(req.ip)with the existingAttemptLimiter(e.g. 30 per minute; over it answerLOGIN_FAILED_URLor 429 withretry-after, logged at warn). - Store the address key on
login_attempts(migration033_login_attempt_address.sql,address TEXT) and cap live attempts per address (e.g. 50): a new attempt from an address at its ceiling evicts that address's oldest attempt instead of counting towards the global cap. KeepLOGIN_ATTEMPTS_MAX. - Record the trade-off in the Security (low): PROPFIND quota walk per child folder; unbounded login_attempts rows #255 DECISIONS entry.
Tests that must fail without the fix
server/test/auth.test.ts: "a flood from one address does not stop other members from signing in" — injectLOGIN_ATTEMPTS_MAXstarts from203.0.113.77; assert that address's live rows never exceed the per-address ceiling, that it is refused once over its rate, and thatlogin(t, 'testuser')from198.51.100.7still completes (302 to the IdP, callback 302 with a session cookie). Removing the per-address limiter/ceiling lets the table fill and the other address gets/?loginError=1.- Keep the existing table-full test but fill it from many distinct addresses so it still proves the global cap.
🤖 Generated with Claude Code
Found by the automatic review round (claude-fable-5-1, 24f3fc6); per CLAUDE.md the fix starts with a failing behaviour test.
Activity
fix(#419): Security (low): 10,000 anonymous GETs to /auth/login block…
BeSovereign commentedon Oct 20, 2026
Fixed: PR #429 squash-merged into
mainafter green CI (one commit;git revertit to undo).