better-auth
1.7.25 · 14 Nov 2026MIT21M / weekRepositoryHomepagenpmAtom feed
1.7.27 is the newest release of 1.x.
In short
1 breaking1 deprecated25 new1 faster53 fixed2 internal
- Breaking
admin: Prevent impersonating admins by default
- Deprecated
sso: Deprecate trustEmailVerified
Security
Fixes 1 advisory that affected 1.4.8
- CriticalBetter Auth Has Two-Factor Authentication Bypass via Premature Session Caching (session.cookieCache)GHSA-xg6x-h9c9-2m83 · 3 Apr 2026Fixed in 1.4.9
13 advisories affect 1.4.9; 1.7.7 fixes them
- Criticalbetter-auth: OAuth state can be used as a Magic Link to sign in as another userGHSA-965c-763c-88jm · 27 Oct 2026Fixed in 1.7.7
- CriticalBetter Auth: OAuth refresh-token replay via missing client authentication on oidc-provider and mcp pluginsGHSA-pw9m-5jxm-xr6h · 7 Jul 2026Fixed in 1.6.11
- Highbetter-auth: Device login approval does not show the requesting client or permissionsGHSA-q84f-53jg-9ppm · 27 Oct 2026Fixed in 1.7.0
- HighBetter Auth: Account takeover via pre-account hijacking on magic-link and email-OTP sign-inGHSA-qq9h-g4jm-xgf3 · 24 Jul 2026Fixed in 1.6.22
- High@better-auth/oauth-provider's OAuth authorization-code grant allows concurrent redemption when two token requests race the find-then-delete primitiveGHSA-7w99-5wm4-3g79 · 7 Jul 2026Fixed in 1.6.11
8 more
- HighBetter Auth: OAuth refresh-token rotation forks the token family on concurrent redemptionGHSA-392p-2q2v-4372 · 7 Jul 2026Fixed in 1.6.0
- HighBetter Auth has insecure cryptographic defaults in oidcProvider: alg=none advertised and plain PKCE accepted by defaultGHSA-9h47-pqcx-hjr4 · 7 Jul 2026Fixed in 1.6.11
- HighBetter Auth has stored XSS in the auth-server origin via javascript: redirect_uri in oidc-provider and mcpGHSA-86j7-9j95-vpqj · 7 Jul 2026Fixed in 1.6.13
- HighBetter Auth has an account takeover issue via OAuth auto-link to unverified pre-registered emailGHSA-g38m-r43w-p2q7 · 7 Jul 2026Fixed in 1.6.11
- HighBetter Auth vulnerable to unauthorized invitation acceptance via unverified email match in organization pluginGHSA-fmh4-wcc4-5jm3 · 7 Jul 2026Fixed in 1.6.11
- HighBetter Auth: Rate limiter keys IPv6 addresses individually and is bypassable via prefix rotationGHSA-p6v2-xcpg-h6xw · 15 May 2026Fixed in 1.4.17
- ModerateBetter Auth: OAuth callback accepts mismatched `state` when cookie-backed state storage is used without PKCEGHSA-wxw3-q3m9-c3jr · 15 May 2026Fixed in 1.6.2
- LowBetter Auth: Stale sessions persist after user deletion across admin, anonymous, and SCIM flowsGHSA-2vg6-77g8-24mp · 7 Jul 2026Fixed in 1.6.11
Release note
Features
Add
ctx.isTrustedDomainhelperDrizzle pg supports JSON
Add Refresh Token Support to Kick OAuth Provider
Add
additionalFieldsoption in verification table schemaAdd patreon social provider
Add a global backgroundTasks config option to defer actions like sending email and updates to run after response is sent
- Breaking
admin: Prevent impersonating admins by default
admin: Add support role with permissions for user updates and enforce role change validation
expo: Last-login-method client plugin
multi-session: Allow to infer additional fields
multi-session: Allow to infer additional fields "
oauth-provider: An oauth 2.1 compliant plugin
oauth-proxy: Add expirty timestamp for encrypted tokens
one-time-token: Support setting session cookie on ott verify
organization: Allow invited users to see organization name
phone-number: Add password length validation for reset functionality
saml: Assertion timestamp validation with per-provider clock skew
saml: Validate SAML crypto algorithms during initial phase
saml: Enforce one-time use of SAML assertions
saml: Reject deprecated SAML signature and digest algorithms
saml: Reject deprecated SAML signature and digest algorithms
sso: Use domain verified flag to trust providers automatically
sso: Add InResponseTo validation
sso: Add OIDC discovery
sso: Add URL normalization and validation to all discovery URLs
Bug Fixes
Add helper types to exports
Avoid throwing on client side
Export organization plugin types
Pathname should be normalized when basePath is set to root
Prematurely deleting active sessions in secondary storage
Make sure non-chunked session data cookie is cleared
Array field handling across adapters and schema generation
StoreStateStrategy default to database if provided
Should always remove 2FA verification token after successful verification
Prevent stateless refresh with database configured
Revert token masking in listSessions route
Compatible with openapi 3.1
Properly merge updated data in account cookie
Preserve
=padding in parsed cookiesUnify SSO/OAuth account linking and add domain-based org assignment to all sign-in flows
Respect BETTER_AUTH_TRUSTED_ORIGINS env variable
Delete verifications with hooks
Respect IP headers in dev/test environments
Trusted origins resolving
Update-user breaking during stateless auth
Export necessary adapter types
Use operator in list members where clause
Don't set state query param if state is not provided
Correct wildcard pattern matching for
trustedOriginsadapter: Add logger creation in adapter factory
adapter: Allow run internal adapter outside context
adapter: Apply
customTransformInputto where clause valuesadmin: Clear admin session cookie on
stopImpersonatingapi-key: Check metadata is enabled for api key update endpoint
api-key: Prevent id update error with MongoDB adapter
auth: Respect trustedOrigins when baseURL is inferred
cli:
secretgenerates emptycli: Deduplicate drizzle schema relationships
cli: Cmd
info --jsonunexpected exit with 1cli: Cmd
info --jsonunexpected exit with 1client: Set session data on refreshManager
cognito: Use %20 encoding for scopes instead of +
core: Allow returning null in getUserInfo in provider options
db: Correctly unwrap validator result in schema parsing
expo: Add missing matcher paths
generic-oauth: Ensure encryptOAuthTokens is respected in account linking flow
kysely: Wrong affected row count in updateMany & deleteMany
line: Enforce nonce
magic-link: Handle query params in errorCallbackUrl
oidc: Compatibility with exact-optional-property
openapi: Mark /get-session response as nullable
organization: Validate role existence in inviteMember endpoint
organization: Allow internal organization creation when disabled for client
passkey: Use deleteVerificationByIdentifier instead of deleteVerificationValue
prisma: Use findFirst instead of findMany for findOne
prisma-adapter: Extract
idto root level for delete operationssaml: Enforce trusted provider check
saml: Remove signature validation bypass
sso: Safely parse provider configs on registration
- Deprecated
sso: Deprecate trustEmailVerified
sso: Enforce domain verification in assignOrganizationByDomain
stripe: Update subscriptionId to use Stripe id
username: Await username validator
Performance
Add index on organizations slug field
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.