Skip to content

Auth abuse protection: rate-limit login/register and enforce a minimum password length #27

Description

@paccloud

What to build

Protect the public auth endpoints. Today registration accepts any non-empty username/password (one character works), and neither login nor register has any rate limiting — leaving the door open to brute force and credential stuffing on both the serverless API and the Express dev server.

Decision needed first: which rate-limit backing store to use on Vercel serverless (e.g. Upstash/Vercel KV sliding window vs. a Postgres-based limiter vs. an edge middleware approach). Express can use an in-memory limiter locally.

Then implement: a burst limit on login/register, and a minimum password length (suggest 8 characters) enforced at registration with a clear error message.

Context: AUDIT_REPORT.md §3.5 and task 1.5 (branch claude/repo-audit-improvement-ozhlau).

Acceptance criteria

  • Infra decision recorded for the serverless rate-limit store
  • A burst of ~20 rapid login attempts from one client receives 429 responses
  • Registration rejects passwords under the minimum length with a clear error
  • Both backends enforce the same rules; normal login UX is unaffected

Blocked by

None - can start immediately (decision first, then implementation)

Activity

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

    bugSomething isn't workingready-for-humanRequires human implementation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions