Skip to main content

Provider login defences

The SABROBOTIX provider login asks for an email address and a password, and nothing else. Two layers stand behind that before a session is issued: SQLite rate limiting with automatic account blocking, and password verification.

There is deliberately no bot challenge. An earlier design had Cloudflare Turnstile in front of the password, and the widget was removed on the owner's decision: the sign-in is for a handful of named people, and a visible verification step on every login was judged to cost more than the attack it prevents. What it prevented is worth naming rather than glossing over — rate limiting alone does not stop a slow distributed attempt, many addresses making few tries each, every one of them under every threshold. That trade is accepted knowingly.

Limits and automatic unlock​

Failed attempts are stored in login_attempts. The identifier is normalized to lowercase, while the IP comes from Cloudflare's CF-Connecting-IP header. Successful attempts do not count toward any threshold.

DimensionFailuresRolling windowBlock
Account identifier515 minutes1 minute
Account identifier830 minutes5 minutes
Account identifier122 hours30 minutes
IP address2010 minutes5 minutes
IP address401 hour30 minutes

The longest active block wins. A blocked request does not extend the block, and every block expires on its own; unlocking never requires a database edit. Rate limiting is checked before PBKDF2 so a rejected request cannot spend the password-hashing latency budget.

Account-enumeration resistance​

Missing accounts perform one real PBKDF2 derivation against a public dummy hash. Every failed response also waits for a 400 ms minimum request duration, uses the same response body, and every rejected credential check records an attempt for the normalized identifier. This keeps unknown and known accounts on the same password path.

The 429 response exposes only that the attempted identifier or source IP has reached a threshold. It does not imply that an account exists. Retry-After contains the remaining automatic-block duration.

Node service configuration​

Nothing here needs configuring. The limits live in lib/oidc/login-defenses.ts and the attempts in SQLite, so a deployment cannot end up with the defences switched off by a variable nobody set.