Skip to content

Security 03: Validate auth input & de-enumerate signup (M1/M2/M3) - #10

Merged
bryanshao07 merged 1 commit into
mainfrom
security/03-input-validation
Jul 28, 2026
Merged

bryanshao07 merged 1 commit into
mainfrom
security/03-input-validation

Conversation

@bryanshao07

Copy link
Copy Markdown
Owner

Security fix 03 — Auth input validation & signup de-enumeration

Audit findings: M1 (password validation), M2/M3 (email validation + signup enumeration)

  • Email is now EmailStr, normalized to lowercase/trimmed on both signup and login, so casing can't create duplicate accounts or bypass the per-account rate limit.
  • Signup password constrained to 12–72 chars (72 = bcrypt truncation limit); login keeps no length constraint so existing passwords still verify.
  • Signup no longer returns "Email already registered" — it returns a generic message and always hashes, so neither wording nor timing confirms an account exists.

New: backend/tests/test_auth_validation.py.


Stacked on security/02-rate-limiting (shares routers/auth.py). GitHub will retarget this to main once #2 merges. Do not merge yet — for review.

@vercel

vercel Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crossover Ready Ready Preview, Comment Jul 28, 2026 7:40am

@bryanshao07
bryanshao07 deleted the branch main July 28, 2026 07:25
@bryanshao07 bryanshao07 reopened this Jul 28, 2026
@bryanshao07
bryanshao07 changed the base branch from security/02-rate-limiting to main July 28, 2026 07:30
- email is now EmailStr, normalized to lowercase/trimmed on both signup and
  login so casing can't create duplicate accounts or bypass the per-account
  rate limit.
- signup password constrained to 12..72 chars (72 = bcrypt truncation limit);
  login keeps no length constraint so existing passwords still verify.
- signup no longer returns "Email already registered"; it returns a generic
  message and always hashes, so neither wording nor timing confirms an account
  exists.

Addresses audit findings M1 (password validation) and M2/M3 (email
validation + signup enumeration).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bryanshao07
bryanshao07 force-pushed the security/03-input-validation branch from a16d7ec to 756d820 Compare July 28, 2026 07:40
@bryanshao07
bryanshao07 merged commit 3627b49 into main Jul 28, 2026
4 checks passed
@bryanshao07
bryanshao07 deleted the security/03-input-validation branch July 28, 2026 07:44

This branch was successfully deployed

1 active deployment
Preview — 756d8204 Deployed Jul 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant