Skip to content

[Bug]: auth per-email attempt limiter is shared across proofs and counts before the credential check #461

Closed

Description

@jimhoyd

Runtime revision and environment

main at d939969 (static source review; not executed against a deployment). Node/OS/deployment: not applicable.

Minimal reproduction

Reported by review, not independently reproduced. Exploit-level detail is intentionally omitted per SECURITY.md.

Weakness: the per-email attempt limiter is keyed only by the account email, and one key is shared by several independent proofs. It is incremented before the credential is checked. A third party who knows an address can therefore make that account's sign-in unavailable for the limiter window without knowing any credential.

  • login:<email> is charged by password sign-in, passkey sign-in, OIDC sign-in and step-up: packages/auth/src/auth-core.ts lines 921 (the attempt helper), 987, 1354, 1388, 1403, 1574, 1619.
  • The limiter itself: packages/auth/src/auth-store.ts lines 645-655 (fixed per-key ceiling, 429 authentication_rate_limited); the key is only cleared on success (line 887).
  • token:<email> is similarly shared by email-code issuance and password reset / verify-email tokens: auth-core.ts lines 1262 and 1431.

Relevant output

Expected: failed guesses against one proof, from one client, cannot deny a different proof or a different client for the same account.

Suggested fix

  • Key the tight limiter by email and client (network/device), and keep a separate, much higher per-email ceiling for distributed guessing.
  • Do not let failed passwords consume the budget for passkey or OIDC proofs (those are not guessable secrets).
  • Split token:<email> so reset and email-code issuance do not share one budget.
  • Ship default per-client limits in the presets so operators get the protection without configuration.

Activity

  1. added
    bug
    extension
    on Sep 22, 2026
  2. added 2 commits that reference this issue on Sep 22, 2026
    592c176
    2a14cf1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugextension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions