Skip to content

[Bug]: auth email sign-in and sign-up codes have no long-window per-account cap #462

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.

Missing control: the 6-digit email sign-in and sign-up codes are bounded per code (a small attempt count and a short expiry) but there is no long-window cap on how many codes can be issued, or how many failed checks can accumulate, for one account over a day. Per-code limits alone do not bound the cumulative guessing budget over time.

  • Sign-in code issuance: packages/auth/src/auth-core.ts:1431; storage and check: packages/auth/src/auth-store.ts lines 1381-1396.
  • Sign-up code issuance: auth-core.ts lines 1132-1133; verification: auth-store.ts lines 743-747.

Suggested fix

  • Add a daily (or similar long-window) per-account cap on code issuance and on failed code checks.
  • Escalate: lengthen the lockout after repeated exhausted codes.
  • Alternatively, or additionally, use longer codes.
  • Document the chosen ceilings in the auth security notes.

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