Intel

AIKIDO-2026-136329

better-auth is vulnerable to Improper Authentication

CVE-2026-121802Published Nov 1, 2026
November 1, 2026

91

CVE Score

Critical

Improper Authentication

Are you affected? Scan for Free

TL;DR

Affected versions of this package are vulnerable to authentication bypass when the expo() plugin from @better-auth/expo is registered. The plugin's public /expo-authorization-proxy endpoint reads the state value from a caller-supplied authorizationURL, and signs it with the application secret (HMAC-SHA256) without checking that the server issued it, returning the signature in a cookie. Because the same secret and computation are used for HS256 JSON Web Tokens (email verification and email-change links) and for the session cookie cache, an unauthenticated attacker can forge valid tokens: knowing only a victim's email address they can sign in as that user and change the account's email address, and with the session cookie cache enabled, knowing a user's ID is enough to act as that user. The same endpoint also acts as an open redirect to any external HTTPS site, and wildcard trustedOrigins entries (e.g. myapp://*) could match URLs outside the intended scheme, host, or path. The fix signs only unexpired state values issued by the server, redirects only to the authorization endpoint origin of a configured provider, and matches wildcard trusted origins by parsed scheme, host, and path.

How do I fix this?

Upgrade the better-auth library to the patch version, and upgrade @better-auth/expo to the same version. Rotate the application secret afterwards, since signatures issued before the fix remain valid until the secret changes. If Expo sign-in through an SSO identity provider fails after upgrading, add the identity provider's origin to trustedOrigins.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your server registers the expo() plugin from @better-auth/expo 1.4.0 or later. The wildcard trusted origin issue additionally requires a wildcard entry in trustedOrigins.

Versions

0.0.1 - 1.7.15

Fixed in 1.7.16

Background info

better-auth is vulnerable to Improper Authentication in versions 0.0.1 - 1.7.15.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea