mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-11-11 00:01:55 +08:00
The access-token endpoint accepted unlimited password attempts; the only existing rate limiters are single-instance helpers for outbound site requests. Add app/application/security/throttle.py, an in-memory LoginThrottle keyed by (client address, normalized username) that locks for 30s after five consecutive failures and doubles the lockout up to 15 minutes. The endpoint answers 429 with Retry-After while locked, counts only real credential failures (an MFA challenge after a correct password does not count), and clears the record on success. X-Forwarded-For is deliberately not trusted because there is no trusted-proxy setting; behind the bundled nginx all requests share one address, so the key degrades to per-username throttling, which is the dimension brute-force protection needs. Sync the dependency snapshot and architecture metrics for the new module. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
4.7 KiB
4.7 KiB