Skip to content

feat(passkeys): add rate limiter on the /options endpoint for authentication#2422

Merged
fadymak merged 2 commits intomasterfrom
fm/auth-1112-pk-auth-rl
Mar 13, 2026
Merged

feat(passkeys): add rate limiter on the /options endpoint for authentication#2422
fadymak merged 2 commits intomasterfrom
fm/auth-1112-pk-auth-rl

Conversation

@fadymak
Copy link
Contributor

@fadymak fadymak commented Mar 13, 2026

Adds rate limiter to the /passkeys/authentication/options endpoint to restrict challenge creation.

@fadymak fadymak requested a review from a team as a code owner March 13, 2026 09:04
@fadymak fadymak merged commit 30b3aeb into master Mar 13, 2026
6 checks passed
@fadymak fadymak deleted the fm/auth-1112-pk-auth-rl branch March 13, 2026 09:19
r.Post("/options", api.PasskeyAuthenticationOptions)
r.With(api.limitHandler(api.limiterOpts.PasskeyAuthentication)).
Post("/options", api.PasskeyAuthenticationOptions)
r.Post("/verify", api.PasskeyAuthenticationVerify)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: LOW

The /passkeys/authentication/verify endpoint lacks rate limiting. While WebAuthn is resistant to brute force, authentication endpoints should consistently apply rate limiting to mitigate automated abuse and align with the security posture of other verification routes in the API.
Helpful? Add 👍 / 👎

💡 Fix Suggestion

Suggestion: Apply the same limitHandler middleware to the /verify route that is already used for the /options route. Replace the plain r.Post("/verify", ...) call with a r.With(api.limitHandler(api.limiterOpts.PasskeyAuthentication)).Post(...) call, consistent with how other verification endpoints (e.g., /verify, /factor/verify) are rate-limited throughout the API.

⚠️ Experimental Feature: This code suggestion is automatically generated. Please review carefully.

Suggested change
r.Post("/verify", api.PasskeyAuthenticationVerify)
r.With(api.limitHandler(api.limiterOpts.PasskeyAuthentication)).
Post("/verify", api.PasskeyAuthenticationVerify)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants