Skip to content

fix(auth): validate authentication state before session issuance - #188

Merged
RentnerKev merged 1 commit into
mainfrom
fix/authentication-state-consistency
Oct 6, 2026
Merged

RentnerKev merged 1 commit into
mainfrom
fix/authentication-state-consistency

Conversation

@RentnerKev

Copy link
Copy Markdown
Member

Summary

Password login and MFA completion now check the current authentication state in the transaction that creates the session. Password changes and second-factor changes share the user lock, and MFA challenges identify the password state and factor they were issued for.

Related issue

Refs #72. This PR handles one item from the security review; the overall review remains open.

Type of change

  • Bug fix

Testing

  • 33 focused tests passed, covering login state, challenge parsing, login results, recent authentication, and session freshness.
  • TypeScript typecheck, scoped Oxfmt, standard and type-aware Oxlint, and git diff --check passed.
  • Existing PostgreSQL and Valkey fixtures were updated; the CI integration jobs verify them against isolated services.

Checklist

  • I tested the relevant functionality.
  • Existing relevant local tests pass.
  • I added or updated tests where appropriate.
  • This PR does not include secrets, credentials, production data, or private certificates/keys.
  • I linked the relevant review item.

Breaking changes

An MFA login challenge issued before the update must be restarted. No schema migration is needed.

Screenshots

None.

@RentnerKev RentnerKev added this to the v1.0.0-beta.1 milestone Oct 6, 2026
@RentnerKev RentnerKev added security Public security hardening or remediation; disclose vulnerabilities privately. area: auth Authentication, accounts, sessions, passkeys, and access control. labels Oct 6, 2026
@github-actions github-actions Bot added the area: database Database schema, migrations, and persistence. label Oct 6, 2026
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: RentnerKev/RentnerProxy/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0fe232de-3f37-49d1-943f-4d5e32e53893
📥 Commits

Reviewing files that changed from the base of the PR and between b2c15bb and b033eb2.

📒 Files selected for processing (10)
  • web/src/server/Auth/Access/sessions.service.ts
  • web/src/server/Auth/Login/login.service.ts
  • web/src/server/Auth/TwoFactor/two-factor.service.ts
  • web/src/server/Valkey/Types/auth-challenges.types.ts
  • web/src/server/Valkey/auth-challenges.service.ts
  • web/src/tests/server/Auth/Login/Types/login-state-test.types.ts
  • web/src/tests/server/Auth/Login/login-state.test.ts
  • web/src/tests/server/Auth/auth.db.test.ts
  • web/src/tests/server/Valkey/auth-challenges.test.ts
  • web/src/tests/server/Valkey/valkey.integration.test.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@RentnerKev
RentnerKev force-pushed the fix/authentication-state-consistency branch from 7254a8e to b033eb2 Compare October 6, 2026 20:54
@RentnerKev
RentnerKev merged commit 1c7f153 into main Oct 6, 2026
25 checks passed
@RentnerKev
RentnerKev deleted the fix/authentication-state-consistency branch October 6, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: auth Authentication, accounts, sessions, passkeys, and access control. area: database Database schema, migrations, and persistence. security Public security hardening or remediation; disclose vulnerabilities privately.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant