Skip to content

BE-01: Fix critical authentication bypass in login() - #906

Merged
chinweobtagaz merged 1 commit into
OpenKnight-Foundation:mainfrom
Binali223:fix/be-01-auth-bypass-password-verification
Jul 29, 2026
Merged

BE-01: Fix critical authentication bypass in login()#906
chinweobtagaz merged 1 commit into
OpenKnight-Foundation:mainfrom
Binali223:fix/be-01-auth-bypass-password-verification

Conversation

@Binali223

Copy link
Copy Markdown
Contributor

Context: The login() handler completely ignores the password and unconditionally returns a valid JWT for user_id = 1.

Location: backend/modules/api/src/auth.rs (Line 73)

Changes:

  • Integrate Argon2 password verification against stored hash in player table
  • Return 401 Unauthorized for incorrect passwords or nonexistent users
  • Replace hardcoded user_id = 1 with derived ID from player UUID
  • Add regression test for failed login attempts

Acceptance Criteria:

  • Integrate Argon2/bcrypt password verification.
  • Return 401 Unauthorized for incorrect passwords.
  • Add regression tests for failed logins.

Closes #781

- Verify password against stored Argon2 hash in player table
- Return 401 Unauthorized for incorrect passwords or nonexistent users
- Replace hardcoded user_id=1 with derived ID from player UUID
- Add regression test for failed login attempts

Closes OpenKnight-Foundation#781
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Binali223 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@chinweobtagaz
chinweobtagaz merged commit 7137547 into OpenKnight-Foundation:main Jul 29, 2026
3 checks passed
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.

BE-01: Critical Authentication Bypass in login()

2 participants