Skip to content

fix(security): upgrade better-auth to 1.7.15 - #244

Open
santoshkumarradha wants to merge 1 commit into
mainfrom
santosh/fix-better-auth-1-7-849b
Open

santoshkumarradha wants to merge 1 commit into
mainfrom
santosh/fix-better-auth-1-7-849b

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

Summary

Monday’s scheduled security run on main (6d15d0f) failed pnpm audit --audit-level=high --prod on three better-auth advisories. 1.6 has no backport; the patch floor is 1.7.7. This PR upgrades dashboard and customer-app to 1.7.15 and completes the 1.7 client migration that Dependabot was previously blocked on.

Advisories:

Changes

  • Pin better-auth to 1.7.15 in both apps and pnpm.overrides
  • Replace signIn.oauth2({ providerId }) with signIn.social({ provider }) and drop genericOAuthClient()
  • Remove issuer / requireIssuerValidation from generic OAuth config (1.7 validates via discovery)
  • Rewrite /api/auth/oauth2/callback/:id → /api/auth/callback/:id so already-registered IdP URIs still land
  • Document the new callback URIs; lift the Dependabot ignore from >=1.7.0 to >=1.8.0

The core user / session / account / verification schema is unchanged on 1.7.3+ (we never ran 1.7.0–1.7.2), so no runtime SQL migration is required.

Test plan

  • pnpm audit --audit-level=high --prod is clean (7 low/moderate only)
  • tsc --noEmit passes in dashboard and customer-app
  • CI green on this branch
  • After merge, operators who already registered /api/auth/oauth2/callback/enterprise-sso should also add /api/auth/callback/enterprise-sso — 1.7 sends the new redirect_uri on the authorize request

Notes for reviewers

This is a fix(security): commit so the next release includes the patched apps. Email/password and magic-link flows are unchanged; SSO is the only client API change.

Open in Web Open in Cursor 

@AbirAbbas

Copy link
Copy Markdown
Contributor

Heads-up: I merged the dependabot js-workspace bump (#243), which also touched pnpm-lock.yaml (it moved the root next override to 16.4.3), so this branch now conflicts in the lockfile only. The package.json files merge cleanly.

Merging main, taking main's lockfile and re-running pnpm install --lockfile-only with pnpm 9.15.0 resolves it. I tried that locally: better-auth 1.7.15 + next 16.4.3, frozen install OK, both apps build, and pnpm audit --audit-level=high --prod is clean. I didn't push it here since your agent is still updating this branch.

The Nov 2 security cron failed on three better-auth advisories
(GHSA-965c-763c-88jm, GHSA-r4xp-prcw-77qf, GHSA-q84f-53jg-9ppm).
The patch floor is 1.7.7; 1.6 has no backport.

Migrate SSO from signIn.oauth2 / genericOAuthClient to signIn.social,
drop the removed issuer fields, and rewrite the old oauth2 callback
path so existing IdP redirect URIs keep working.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Santosh kumar <santoshkumarradha@users.noreply.github.com>
@cursor
cursor Bot force-pushed the santosh/fix-better-auth-1-7-849b branch from 1179e68 to dc820a2 Compare November 3, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants