Repository navigation
fix(control): cap login lifetime and expose safe session revocation - #258
Merged
Merged
Conversation
Owner
Author
|
Review follow-up implemented in Browser session listing/revocation uses its own bounded 60/user/minute budget and 4096 buckets, independent of CLI relay traffic. Pinned Better Auth fixtures exhaust the CLI budget, successfully list/revoke that same owner's leaked login from the browser, and then observe bearer rejection. Browser quota limits and reverse isolation remain enforced. Cookie/Origin/ownership guards and token-free metadata are unchanged. Verified: full Control typecheck/build, 104 tests across 15 files, and documentation/i18n checks. Both budgets remain process-local; authenticated cookie traffic can exhaust its own budget. No real OAuth or production changes; draft retained. |
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cap browser and device-login Control sessions at 24 hours from creation, without activity refresh. Cap existing sliding rows at startup without extending earlier expiry. Add metadata-only account session listing and ID-based revocation, document separate device/login revocation, and surface stored-login 401 as
login_expired.Closes #234
Type
Checklist
Verified against
Node 24.16.0/Better Auth 1.7.5, Python 3.13.7, macOS arm64: independently ran typecheck/build and the complete Control suite (102 tests in 15 files), plus i18n tests. The isolated browser fixture verified list, confirmation cancellation, individual/other/all revocation, invalidated-session 401 guidance and revoke-all redirect to login. Synthetic cookie and owned server were cleaned up.
Independent read-only review led to additional tests for malformed/legacy dates, claim-present revocation, exact denial/routing and response headers. A pinned-handler fixture demonstrated bearer authentication could emit signed credentials; Authorization-bearing auth responses now strip
set-cookie/set-auth-token, preserving genuine cookie responses. The regression exercises the resulting cookie/device-flow boundary.Notes
Cookie + Origin/Fetch Metadata checks are transport safeguards, NOT proof of human presence or cryptographic device binding. One account login can manage multiple devices; users must revoke login and device separately. Unsupported numeric or malformed stored dates fail closed and may require immediate login after upgrade. Browser sessions also expire absolutely at 24 hours.
No production deployment, real OAuth login, live message/ACK, service restart or 24-hour real-time soak performed. Draft only; no merge/release authorization.