Skip to content

[Bug]: auth password hashing returns 503 to every caller when two global slots are busy #464

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.

Password hashing is limited to two concurrent derivations process-wide. When both slots are in use, every further caller — sign-in, registration, password change — immediately gets 503 password_hash_busy:

  • packages/auth/src/auth-core.ts lines 674-686 (derive) and 709-710 (legacy-hash verification).

Because the limit is global and not per client, a small amount of concurrent password traffic from one source is enough to fail password operations for everyone.

Suggested fix

  • Replace the immediate 503 with a short, bounded wait queue (bounded length and wait time) before refusing.
  • Add a default per-client limit on password operations so one client cannot hold both slots.
  • Document the concurrency ceiling and how to size it.

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