Skip to content

fix(#265): uniform error messages for auth failures#269

Closed
DogukanUrker wants to merge 1 commit into
mainfrom
fix/265-observable-response-discrepancy
Closed

fix(#265): uniform error messages for auth failures#269
DogukanUrker wants to merge 1 commit into
mainfrom
fix/265-observable-response-discrepancy

Conversation

@DogukanUrker

Copy link
Copy Markdown
Owner

Fix for #265: CWE-204 - Observable response discrepancy

What Changed

  • app/routes/login.py: Unified error messages for "user not found" and "wrong password" — both now use message="password"
  • app/routes/password_reset.py: Unified error messages for "user not found" — changed from message="not_found" to message="wrong" (matches the existing "wrong code" message)

Files Changed

  • app/routes/login.py (line 65)
  • app/routes/password_reset.py (line 173)

Deliberately Left Untouched

  • Password reset code generation (line 128)
  • Email sending logic (lines 122-158)
  • Password hash verification (line 69)
  • password_reset.py line 63: not_found message in the code-verified path (not a user enumeration vector — requires a valid reset code first)

Notes

  • This PR was opened as DRAFT for human review.
  • Local E2E tests could not run (no browser available).
  • All changed files pass py_compile verification.

Closes #265

- login.py: change 'not_found' to 'password' so user-not-found and
  wrong-password return the same message (CWE-204 fix)
- password_reset.py: change 'not_found' to 'wrong' for the same reason
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f3f47d1b-3e90-4529-8cb3-8e41a9bb9772

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/265-observable-response-discrepancy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CWE-204: Observable response discrepancy (user enumeration)

1 participant