better-auth
1.7.25 · 14 Nov 2026MIT20.8M / weekRepositoryHomepagenpmAtom feed
Upgrading better-auth From 1.3.3 to 1.6.22
84 releases in betweennotes for 74
Counted from 74 of 84 release notes. Advisories are counted from the advisory database, in full.
Start here
Before you upgrade
Tick each one off as you go- Breaking1.6.2
- Breaking1.6.0
- Breaking1.5.0
- Breaking1.5.0
- Breaking1.5.0
- Breaking1.4.9
- Breaking1.4.6
- Breaking1.4.0
- Breaking1.4.0
- Breaking1.4.0
Security
4 advisories still affect 1.6.22
- @better-auth/drizzle-adapter: Concurrent requests can exceed rate limits on PostgreSQLlow · GHSA-44jh-23m7-hpcf
- better-auth: OAuth state can be used as a Magic Link to sign in as another usercritical · GHSA-965c-763c-88jm
- better-auth: Device login approval does not show the requesting client or permissionshigh · GHSA-q84f-53jg-9ppm
- better-auth: OAuth Proxy lets an attacker sign in as another userhigh · GHSA-r4xp-prcw-77qf
Upgrading to 1.7.7 clears them.
Fixes 14 advisories affecting 1.3.3
- Better Auth: Stale sessions persist after user deletion across admin, anonymous, and SCIM flowslow · GHSA-2vg6-77g8-24mp
- Better Auth affected by external request basePath modification DoShigh · GHSA-569q-mpph-wgww
- @better-auth/oauth-provider's OAuth authorization-code grant allows concurrent redemption when two token requests race the find-then-delete primitivehigh · GHSA-7w99-5wm4-3g79
- Better Auth has stored XSS in the auth-server origin via javascript: redirect_uri in oidc-provider and mcphigh · GHSA-86j7-9j95-vpqj
- Better Auth: Unauthenticated API key creation through api-key pluginhigh · GHSA-99h5-pjcv-gr6v
- Better Auth has insecure cryptographic defaults in oidcProvider: alg=none advertised and plain PKCE accepted by defaulthigh · GHSA-9h47-pqcx-hjr4
- Better Auth vulnerable to unauthorized invitation acceptance via unverified email match in organization pluginhigh · GHSA-fmh4-wcc4-5jm3
- Better Auth has an account takeover issue via OAuth auto-link to unverified pre-registered emailhigh · GHSA-g38m-r43w-p2q7
- Better Auth: Rate limiter keys IPv6 addresses individually and is bypassable via prefix rotationhigh · GHSA-p6v2-xcpg-h6xw
- Better Auth: OAuth refresh-token replay via missing client authentication on oidc-provider and mcp pluginscritical · GHSA-pw9m-5jxm-xr6h
- Better Auth: Account takeover via pre-account hijacking on magic-link and email-OTP sign-inhigh · GHSA-qq9h-g4jm-xgf3
- Better Auth: OAuth callback accepts mismatched `state` when cookie-backed state storage is used without PKCEmoderate · GHSA-wxw3-q3m9-c3jr
- Better Auth's rou3 Dependency has Double-Slash Path Normalization which can Bypass disabledPaths Config and Rate Limitshigh · GHSA-x732-6j76-qmhm
- Better Auth Has Two-Factor Authentication Bypass via Premature Session Caching (session.cookieCache)critical · GHSA-xg6x-h9c9-2m83
- 1.6.11
Fixed an invitation takeover vulnerability by enabling
requireEmailVerificationOnInvitationby default and extending the verification gate togetInvitationandlistUserInvitations - 1.6.2
Fixed OAuth state verification against cookie-stored nonce to prevent CSRF
- 1.5.0
customSyntheticUseroption: Support plugin fields in enumeration-protected responses (#8097). - 1.5.0
Prevent OTP reuse via race condition: Atomically invalidate OTPs on use.
- 1.5.0
Prevent user enumeration: In email-otp when sign-up is disabled, and on sign-up with required email verification.
- 1.5.0
Stricter default rate limits: For password reset and phone number verification endpoints.
- 1.5.0
Separate CSRF and origin checks: More granular request validation.
- 1.5.0
Prevent trial abuse: Check all user subscriptions before granting a free trial.
- 1.5.0
SAML ACS error redirect hardening: Prevent open redirect in error flows.
- 1.5.0
IPv6 address normalization and subnet support: For rate limiting and IP-based rules.
Release by release
- Fixed
Fixed unproven credentials not being revoked during magic link and email OTP sign-in
- Fixed
Fixed server-side OAuth requests to refuse redirect responses instead of following them
- Fixed
- Fixed
Fixed rate limits to be enforced before plugin request handlers run
- Fixed
Fixed admin permission changes and bans to take effect immediately, even when session cookie cache is enabled
- Fixed
Fixed
deviceAuthorization()throwing aZodErrorwhen called without aschemaoption under Zod v4 - Fixed
Fixed Google hosted-domain validation to apply consistently across all sign-in flows, including Google One Tap
- Fixed
- Fixed
Fixed account-linking logs to route through the configured logger
- Fixed
Fixed TypeScript inference errors by declaring inherited
APIErrorproperties - Fixed
Fixed refresh cookie
Max-Ageto be capped atexpiresIn
- Fixed
- New
Added support for pre-binding device codes to a specific user in the device authorization plugin
- Fixed
Fixed headerless session checks
- Fixed
Fixed cookie cache fallback lookup
- Fixed
Fixed
sendVerificationEmailerrors not being surfaced to the client
- New
- New
Added
internalAdapter.reserveVerificationValueto atomically record single-use markers, ensuring only one concurrent caller succeeds for replay-protected operations. - New
Added the
incrementOneadapter method andSecondaryStorage.incrementfor atomic counter updates, enabling strict rate-limit and usage-counter enforcement under concurrent load. - Fixed
Fixed
getCookieCacheto returnnullfor expired sessions instead of treating stale signed cookies as live sessions. - Fixed
Fixed the delete-account confirmation link to prevent duplicate account deletions from concurrent callback requests.
- New
- New
Added an experimental
oauthPopupplugin for popup-based OAuth sign-in, enabling sign-in inside cross-site iframes by completing the OAuth flow in a popup and passing the session token back via thebearerplugin - New
Added
internalAdapter.reserveVerificationValuefor atomic single-use markers, ensuring exactly one concurrent caller succeeds and the rest see the marker as already taken, hardening replay protection across all verification flows. Database-backed storage is atomic; secondary-storage-only mode is best-effort. - New
Added the optional
incrementOneadapter method andSecondaryStorage.incrementfor atomic counter updates with conditional row guards, enabling strict enforcement of rate limits and usage counters. Adapters without native support fall back to a transaction-based approach. - Fixed
Fixed
getCookieCacheto returnnullfor an expired session instead of stale data, so middleware no longer treats an expired signed cookie as a live session.
- New
- Fixed
Fixed SIWE verification to bind the signed message to server state before creating a session, preventing acceptance of signatures produced for a different message, earlier nonce, or unrelated domain.
- Fixed
Fixed PayPal ID token verification to validate the signature, issuer, audience, expiration, and nonce against PayPal's JWKS (RS256) or client secret (HS256), rejecting tokens that pass only structural checks.
- Fixed
Fixed Google
hd(hosted domain) enforcement to verify thehdclaim on the verified ID token and callback profile, preventing accounts outside the configured Workspace domain from signing in. - Fixed
Fixed
verifyAccessTokenremote introspection to reject tokens with a missing or mismatchingaudclaim; setremoteVerify.allowMissingAudience: trueto permit tokens where the introspection response legitimately omitsaud.
- Fixed
- Fixed
Fixed the
listSessionsendpoint to properly enforce fresh-age session checks - Fixed
Fixed
unbanUser,setRole, andadminUpdateUserto returnUSER_NOT_FOUNDinstead of a generic 500 when the target user does not exist - Fixed
Fixed Kysely migration constant import path to restore Kysely 0.28 and 0.29 compatibility
- Fixed
Improved cookie regex character ranges for more accurate cookie parsing
- Fixed
23 internal lines (docs, tests, tooling) left out.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.