Repository navigation
Conversation
…revoked OAuth sign-ins Passkey login start and finish and the magic link check had only the global limiter. Login start also left a challenge row behind on every call and recorded a lockout-counting login_failed for a credential id the account does not have. OAuth sign-in never checked users.revoked.
…ess cap A cap across an account's attempts let a stranger with pre-auth tokens from the owner's address block the owner's passkey sign-in. The limits are now per attempt, with a per-address cap derived from flow_rate_limits.otp.perIp so a deployment that raised it for shared addresses raises this with it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #600 (L-API-7, L-API-8).
L-API-7: flow limits on passkey sign-in and magic link polling
POST /webauthn/login/startandPOST /webauthn/login/finish(webauthnLoginIdentityLimiter,webauthnLoginIpLimiter):flow_rate_limits.otp.perIp, which is 100 by default. A deployment that raised the OTP per-address limit for carrier NAT or an office gets a matching rise here.GET /magic-link/check(magicLinkCheckLimiter): 300 per attempt per window. The client polls every five seconds over the fifteen-minute life of a link, which is 180 checks.flow_rate_limits.windowSeconds. The per-attempt allowances are fixed, because a newflow_rate_limitskey needs a types release.defineRoute, and the keys use the token's subject, so a decoy and a real account get the same answers.login/startthat matches no credential on the account, or arrives on a token with no attempt id, is recorded aswebauthn_login_failedrather thanlogin_failed, so it no longer counts toward lockout. Thelogin_failedlet anyone holding a pre-auth token lock the owner out by asking for a credential id the account does not have.L-API-8: OAuth sign-in refuses revoked accounts
resolveOAuthUserchecksusers.revokedon every path that returns an existing account (a linked identity, an imported user matched by external id, or an email match). It throwsOAuthAccountRevokedErrorbefore any claim or link.login_method_disabled, the same answer it gives other accounts that may not use the method, and logsoauth_login_failedwith the reasonaccount_revoked.Contract
TOO_MANY_REQUESTS_BODY, as on every other flow limiter.login_method_disabledfor a revoked account. That status and body were already in its schema.login_failedtowebauthn_login_failed. It now counts toward sign-in failure metrics as a passkey failure rather than as a generic login failure.openapi.jsonandsrc/generated/api.tsare regenerated for the updated OAuth callback description.Tests
tests/integration/rateLimit/identityFlowLimits.spec.ts: per-attempt allowances, a stranger's attempts not reaching the owner's, the address fallback, and the address cap followingotp.perIp.tests/unit/services/webauthnChallengeService.spec.ts: challenge collection before issue.tests/integration/webauthn/webauthn.spec.ts: a refused start is not a lockout failure.tests/integration/oauth/oauth.spec.ts: revoked accounts are refused on the email-match and linked-identity paths, before claiming or linking.