🚀 Feature: rate limit brute force protection #57

Closed
opened 2025-10-07 23:51:12 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @lordraiden on GitHub.

Feature description

A determined attacker can spam the /api/webauthn/login/finish endpoint with millions of crafted assertions, trying to:trigger the passkey device repeatedly (DoS against the user’s phone/YubiKey), orfind implementation bugs (signature malleability, TOFU downgrades, etc.)

With a SQLite backend by default each failed assertion = 1 DB write. A trivial for loop can fill the disk or exhaust IOPS.

Current code ( backend/internal/handler/webauthn.go ) returns 400/401 on failure but does not count or block. No metrics, no logs with IP/user correlation.

Pitch

This is the technical proposal of AI in case it could be helpful

https://chatgpt.com/s/t_68b1c2af33f08191a31f4625b54dc757

Originally created by @lordraiden on GitHub. ### Feature description A determined attacker can spam the /api/webauthn/login/finish endpoint with millions of crafted assertions, trying to:trigger the passkey device repeatedly (DoS against the user’s phone/YubiKey), orfind implementation bugs (signature malleability, TOFU downgrades, etc.) With a SQLite backend by default each failed assertion = 1 DB write. A trivial for loop can fill the disk or exhaust IOPS. Current code ( backend/internal/handler/webauthn.go ) returns 400/401 on failure but does not count or block. No metrics, no logs with IP/user correlation. ### Pitch This is the technical proposal of AI in case it could be helpful https://chatgpt.com/s/t_68b1c2af33f08191a31f4625b54dc757
Author
Owner

@stonith404 commented on GitHub:

We already have a global rate limiter and specific limits for critical endpoints. See here:
4a1e116b81/backend/internal/controller/webauthn_controller.go (L24)

@stonith404 commented on GitHub: We already have a global rate limiter and specific limits for critical endpoints. See here: https://github.com/pocket-id/pocket-id/blob/4a1e116b814b2ca6d7b8728b40db2e86f3482ee5/backend/internal/controller/webauthn_controller.go#L24
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#57