# Better Auth security release (Nov 2026): upgrade to 1.7.16 to stop Expo account takeover

> Canonical page (link this when citing): https://unbreakmyapp.vercel.app/fixes/better-auth-expo-account-takeover-below-1-7-16.html
> Category: Auth | Tools: Cursor, v0, Bolt, Replit | Published: 2026-11-09 | Updated: 2026-11-09

## The error

GHSA-4wq4-2ppv-q3hg / CVE-2026-121802 (critical, CVSS 9.1): @better-auth/expo below 1.7.16 lets an attacker who knows a user's email change that account's email and sign in as them / npm audit or Dependabot flags better-auth or @better-auth/* below 1.7.16

## Why it happens

Better Auth is a popular TypeScript auth library that AI coding tools often add to Next.js and Expo (React Native) apps. On 3 November 2026 the Better Auth team shipped a coordinated security release, 1.7.16 (and 1.8.0-beta.5 on the beta line), fixing 12 advisories. The critical one is in the expo() server plugin from @better-auth/expo, versions 1.4.0-beta.6 up to 1.7.15. That plugin adds a public endpoint, /expo-authorization-proxy, that helps the phone's browser start a social sign-in. It took the OAuth state value from the caller's URL and signed it with your application secret without checking that the server had issued it. Better Auth uses the same secret to sign email verification and email-change tokens and, when enabled, the compact session cookie cache, so an attacker could get the server to sign a forged token. Per the advisory, an unauthenticated attacker who knows a user's email can sign in as that user and change the account's email, with no action from the user; with the session cookie cache on, knowing a user's ID is enough to act as them. The same endpoint was also an open redirect, and wildcard trustedOrigins entries (like myapp://* or https://*.example.com) could match URLs you did not mean to trust. You are affected if your server registers expo(); no other setting is needed. The other advisories in the release (phone number claiming, Electron sign-in leaking the secret, revoked sessions staying valid, Stripe billing targeting another customer, organization role padding and more) affect other plugins, so upgrading every Better Auth package matters even if you do not use Expo.

## How to fix it

1. Find out what you run. Check package.json and your lockfile for better-auth and every @better-auth/* package (expo, stripe, electron, passkey, kysely-adapter and so on), or run npm ls better-auth @better-auth/expo. Then search your server auth config (often lib/auth.ts or auth.ts) for expo( in the plugins list. If expo() is registered and the version is 1.4.0-beta.6 to 1.7.15 (or 1.8.0-beta.0 to beta.4), you have the critical bug.
2. Upgrade every Better Auth package together to the same patched version: 1.7.16 on the stable line, or 1.8.0-beta.5 on the beta line. For example npm install better-auth@1.7.16 @better-auth/expo@1.7.16 (add every other @better-auth/* package you use). The separate packages ship with the same version numbers as better-auth, so mismatched versions are a red flag. Update the Expo app's client package too so client and server match.
3. Redeploy the server. The fix only protects you once the new version is actually running in production, so check the deployment build log or your server's package versions after the deploy, not just your local lockfile.
4. Rotate the application secret if the vulnerable endpoint was reachable. This is the BETTER_AUTH_SECRET environment variable (or the secret option in betterAuth()). Signatures issued before the fix stay valid until the secret changes, so upgrading alone does not cancel tokens an attacker may already hold. Generate a new long random value, set it in your host's environment variables for production, and redeploy. Expect existing sessions and pending verification or email-change links signed with the old secret to stop working, so users may need to sign in again.
5. If Expo sign-in through an SSO identity provider breaks after upgrading, add that identity provider's origin to trustedOrigins. Review any wildcard trustedOrigins entries and replace them with exact origins where you can; patched versions match wildcards by parsed scheme, host and path, so a URL that used to slip through may now be rejected.
6. Check for signs of abuse. Look in your user table for unexpected email changes since you deployed the affected version (compare updated emails against support tickets or old backups), look at your auth logs for requests to /expo-authorization-proxy with unusual state values or external redirect targets, and reach out to any user whose email changed without them asking.
7. Read the advisory for each other plugin you use, because some need a cleanup step after upgrading: the Stripe plugin advisory says to find Stripe customer IDs linked to more than one user and check them against the customer's metadata.userId; the phone number plugin advisory says to remove phone numbers whose verification never completed; the Electron plugin advisory says to treat the auth secret and social provider client secrets as exposed and rotate all of them.
8. If you cannot upgrade right now and you do not use Expo social sign-in, remove the expo() plugin from the server config and redeploy. If you do need it, the advisory's stopgap is to block requests to /expo-authorization-proxy (under your auth base path) whose authorizationURL carries a state value that is not exactly 32 characters of A-Z, a-z, 0-9, - and _. That blocks the signing problem only, so still upgrade.
9. Do not rely on a firewall alone. Vercel says it deployed free WAF rules that block the exploitable request patterns for projects hosted on Vercel, but its bulletin also says a WAF cannot invalidate signatures forged before the rules went live and that upgrading (plus secret rotation for expo() users) is required.

## Error codes this fixes

- `GHSA-4wq4-2ppv-q3hg / CVE-2026-121802` (Better Auth (critical)): https://unbreakmyapp.vercel.app/errors.html#ghsa-4wq4-2ppv-q3hg-cve-2026-121802

## Fix prompt (paste into Lovable, Bolt, Cursor, Replit or v0)

```text
My app uses Better Auth. Check whether it is affected by the November 2026 Better Auth security release (GHSA-4wq4-2ppv-q3hg, critical account takeover in @better-auth/expo below 1.7.16). 1) List the installed versions of better-auth and every @better-auth/* package from package.json and the lockfile, and tell me whether the server config registers the expo() plugin. 2) Upgrade all of them to the same patched version, 1.7.16 (or 1.8.0-beta.5 if we are on the 1.8 beta), including the Expo client package, and fix any type errors from the upgrade without removing auth checks. 3) List every trustedOrigins entry and flag any wildcard. 4) Tell me exactly where BETTER_AUTH_SECRET is set for production so I can rotate it myself; do not print or commit any secret. 5) List the other Better Auth plugins we use (stripe, phone number, electron, organization, admin, passkey, email OTP) and the post-upgrade cleanup step each advisory asks for. Explain every change in one line.
```

## FAQ

### Am I affected if I do not have an Expo app?

The critical account takeover needs the expo() server plugin from @better-auth/expo registered on your server. If it is not there, that bug does not apply, but the same release fixed 11 other advisories across core and other plugins, so you should still upgrade every Better Auth package to 1.7.16.

### Is upgrading enough?

Not if you used expo(). Signatures created before the fix stay valid until the application secret changes, so after upgrading you also need to rotate BETTER_AUTH_SECRET and redeploy. Some other plugins need data cleanup too; read the advisory for each plugin you use.

### Will rotating the secret log my users out?

Expect it to. The secret signs sessions and verification links, so cookies and links signed with the old secret stop being trusted. Users sign in again; that is the point, since it also cancels anything an attacker forged.

### My app is on Vercel. Am I already protected?

Partly. Vercel says it added WAF rules that block the known exploit requests for projects it hosts, at no cost, but it also says not to rely on them: they cannot invalidate tokens forged earlier, and some of the other issues can only be fixed by upgrading.

### Which versions are patched?

better-auth and all @better-auth/* packages 1.7.16 on the stable line, and 1.8.0-beta.5 on the beta line. The affected @better-auth/expo range is 1.4.0-beta.6 up to (not including) 1.7.16, plus 1.8.0-beta.0 to 1.8.0-beta.4.

## Sources (official documentation)

- [Better Auth advisory GHSA-4wq4-2ppv-q3hg (@better-auth/expo)](https://github.com/better-auth/better-auth/security/advisories/GHSA-4wq4-2ppv-q3hg)
- [GitHub Advisory Database: GHSA-hv45-wgqh-c9j5 (CVE-2026-121802)](https://github.com/advisories/GHSA-hv45-wgqh-c9j5)
- [Better Auth release v1.7.16](https://github.com/better-auth/better-auth/releases/tag/v1.7.16)
- [Vercel: Better Auth November 2026 security release](https://vercel.com/kb/bulletin/better-auth-november-2026-security-release)
- [Better Auth: Expo integration](https://www.better-auth.com/docs/integrations/expo)
- [Better Auth: Options reference (secret, trustedOrigins)](https://www.better-auth.com/docs/reference/options)

## Related fixes

- [Your API keys may have leaked: how to rotate every key without breaking your app](https://unbreakmyapp.vercel.app/fixes/rotate-api-keys-after-leak-or-breach.html)
- [Someone reported a security hole in my vibe-coded app: what to do first](https://unbreakmyapp.vercel.app/fixes/vibe-coded-app-security-hole-reported-first-steps.html)
- [User is logged out after page refresh](https://unbreakmyapp.vercel.app/fixes/session-lost-on-refresh.html)
- [Error 400: redirect_uri_mismatch (Google sign-in)](https://unbreakmyapp.vercel.app/fixes/oauth-redirect-uri-mismatch.html)
- [Users can change the price at checkout: stop trusting amounts sent from the browser to Stripe](https://unbreakmyapp.vercel.app/fixes/stripe-checkout-price-from-client-tampering.html)
- [Login rate limit only counts per email: credential stuffing gets through](https://unbreakmyapp.vercel.app/fixes/login-rate-limit-only-per-email-credential-stuffing.html)

---
Unbreak My App: free fixes for broken vibe-coded apps. https://unbreakmyapp.vercel.app/
