Skip to content

[Bug]: auth makes account existence observable, contrary to JSON-API.md #463

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.

packages/auth/docs/JSON-API.md promises no user-enumeration signal (lines 91, 97, 269), but several paths make account existence observable:

  • Registration returns 409 registration_unavailable for an existing email versus 201 for a new one when email verification is off — packages/auth/src/auth-store.ts:827.
  • Waitlist returns 409 versus 202 — auth-store.ts:1275.
  • /signup/complete redirects to a different target depending on whether the account already existed — packages/auth/src/auth-signup.ts:100.
  • forgot-password, send-email-code and recover-factor await the email sender only when the account exists, so the response is observably different between the two cases.

Relevant output

Expected: responses indistinguishable for existing and unknown addresses, matching the documented contract.

Suggested fix

  • Return the same status and body for existing and new addresses on registration and waitlist (notify the existing owner by email instead).
  • Use one redirect target from /signup/complete for both outcomes.
  • Send email asynchronously (queue or detached task) so response handling does not depend on whether a message was sent.
  • Or, if any of these are intentional when verification is off, say so in JSON-API.md.

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