better-auth
1.7.25 · 14 Nov 2026MIT21M / weekRepositoryHomepagenpmAtom feed
1.7.27 is the newest release of 1.x.
In short
3 new34 fixed
Security
5 advisories affect 1.6.17; 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
- Highbetter-auth: OAuth Proxy lets an attacker sign in as another userGHSA-r4xp-prcw-77qf · 27 Oct 2026Fixed in 1.7.7
- 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
- Low@better-auth/drizzle-adapter: Concurrent requests can exceed rate limits on PostgreSQLGHSA-44jh-23m7-hpcf · 27 Oct 2026Fixed in 1.7.7
Release note
The section about better-auth of a note shared by several packages.
better-auth
Features
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
Bug Fixes
Fixed
getCookieCacheto returnnullfor an expired session instead of stale data, so middleware no longer treats an expired signed cookie as a live session.Fixed a race condition where a delete-account confirmation link could delete the account more than once when its callback was opened concurrently.
Fixed a race condition where a one-time token could be redeemed for a session more than once when redeemed concurrently.
Fixed a race condition where a password reset token could change the password more than once when used from concurrent requests.
Fixed Reddit sign-in to assign a non-routable placeholder address (
<id>@reddit.invalid) to users with no email, instead of one on the realreddit.comdomain, preventing accidental mailbox matches. The address stays unverified, andmapProfileToUsercan supply a real email.Fixed Sign-In with Ethereum to prevent a nonce from being used to sign in more than once when submitted from concurrent requests.
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.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 expired two-factor sign-in challenges from completing login, and prevented the same challenge from creating more than one session when verified concurrently.
Fixed captcha provider verification to time out after 10 seconds and fail closed, preventing a slow or unreachable provider from blocking requests indefinitely.
Fixed
/delete-user/callbackto reject account deletion when the session has been revoked server-side, instead of proceeding within the cookie-cache window. Deployments that keep sessions only in the cookie are unaffected.Fixed concurrent requests from slipping past the configured rate limit, resolved unbounded memory growth in the in-memory rate-limit store, and made the database backend remove expired entries automatically. A custom rate-limit storage may implement a new optional
consumemethod for strict enforcement.Fixed team deletion to preserve pending invitations, which now drop the removed team and remain valid for their remaining teams or as organization-level invitations.
Downgraded expected auth validation failures from error logs to warnings.
Fixed expired MCP access tokens from being accepted, and restricted refresh token acceptance to authorizations that included the
offline_accessscope.Fixed team member limits to be enforced on
addMemberandadd-team-memberpaths, preventing teams from exceeding theirmaximumMembersPerTeamcap, and ensured a rejectedaddMemberdoes not create the organization memberFixed generic OAuth sign-in for providers whose userinfo response lacks a
suboridfield whenmapProfileToUserderives the account idFixed single-use credentials, counters, and replay markers to be handled atomically under concurrent requests
Fixed stateless OAuth deployments to correctly read account info and tokens when different server instances handle sign-in and subsequent requests
Fixed
admin.setUserPasswordto create a credential account for users who only have social or magic-link accounts, enabling direct password assignment without manually modifying theaccounttableFixed
updateSessionto accept custom session fields inferred frominferAdditionalFieldsFixed duplicate
/get-sessionrequests triggered by focus and other browser events, stabilized client hook data references to reduce unnecessary re-renders, and resolved session state getting stuck loading after unmounting during an in-flight requestFixed the OpenAPI schema to mark model
idfields as requiredFixed
updateMemberRoleto reject unknown or malformed role values, validating them against configured static and dynamic rolesFixed a memory leak where the JWKS cache grew on every access token verification.
Fixed Google One Tap to require a configured client ID and reject ID tokens issued for a different application, preventing unauthorized sign-ins.
Fixed a race condition where polling for a device-authorization token could redeem the same approved device code more than once.
Fixed account cookie handling when switching users in the same browser, preserving the fresh cookie instead of expiring it from stale request state.
Refactored
role.authorizecontrol flow without changing existing authorization behaviorFixed a race condition where submitting the same email OTP from concurrent requests could sign in more than once or exceed the attempt limit.
Fixed a race condition where submitting the same phone-number OTP from concurrent requests could sign in more than once or exceed the attempt limit.
Fixed a race condition where submitting the same two-factor OTP from concurrent requests could sign in more than once or exceed the attempt limit.
Improved the Have I Been Pwned plugin to check submitted passwords on more endpoints by default, including email-OTP and phone-number reset-password routes and admin create-user and set-user-password routes.
Fixed multi-session
set-activeandrevokeendpoints to only act on sessions the caller holds a signed cookie for, preventing unauthorized activation or revocation of other sessions.Fixed the OIDC
/oauth2/endsessionendpoint to reject cross-site GET logout requests carrying only a session cookie, while leaving logout authenticated by a validid_token_hintunaffected.Fixed WeChat sign-in to succeed without an email address by assigning a stable placeholder, matching the behavior expected from the default configuration.
For detailed changes, see CHANGELOG
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.