improvement(auth): bump better-auth to 1.6.23 and add trusted-proxy client IP resolution#5857
Conversation
…lient IP resolution
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryHigh Risk Overview Adds optional Updates a billing authorization comment to reference @better-auth/stripe 1.6.23 (no logic change). Reviewed by Cursor Bugbot for commit eba2cd0. Configure here. |
Greptile SummaryThis PR upgrades Better Auth and adds trusted-proxy client IP resolution. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "chore(deploy): expose AUTH_TRUSTED_PROXI..." | Re-trigger Greptile |
…@better-auth/stripe 1.6.23
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit eba2cd0. Configure here.
Summary
better-auth,@better-auth/sso, and@better-auth/stripefrom 1.6.13 to 1.6.23 (1.6.24 was published today and is blocked by our 7-dayminimumReleaseAgesupply-chain gate; the only change it adds is an emailOTP origin-validation fix we can pick up later)advanced.ipAddress.trustedProxies(added upstream in 1.6.21) behind a new optionalAUTH_TRUSTED_PROXIESenv var — comma-separated proxy IPs/CIDRs; the forwarded-IP chain is walked right to left, trusted hops are skipped, and the first untrusted address becomes the client IPBackwards-compat audit
Three-way audit performed: full release-notes + PR review for all 10 releases, field-by-field DB schema diff (programmatic cross-check of 1.6.23's
getAuthTablesoutput for our exact plugin set against@sim/db/schema), and a call-site cross-check of everyauth.api.*/client usage against the installed 1.6.23 dist source.Clean:
ssoProvider.domainVerified) is gated behinddomainVerification.enabled, which we don't set, and writes to it are dropped by the adapter's schema-field filter/update-session(org activation goes throughsetActive), no admin call passes role/ban viadata, socket reconnects mint fresh one-time tokens (atomic-consume fix is a no-op for us),customSession/databaseHooks/session-config semantics unchangedPre-deploy actions:
accountLinking.trustedProviders— ourSSO_TRUSTED_PROVIDERS/SSO_TRUSTED_PROVIDER_IDSlists are now inert for SSO. Auto-linking an SSO login to an existing same-email account now requires the IdP to assert a verified email (OIDCemail_verified— strictly booleantrue/"true"now — or a SAMLemailVerifiedattribute mapping). Auditsso_providerrows before deploy: confirm each tenant's IdP asserts verified email, or affected users get "account not linked" on sign-inAUTH_TRUSTED_PROXIESMUST be set in cloud prod as part of this deploy — hard requirement, not hygiene. Better Auth'''s built-in rate limiter is on by default in production (sign-in/sign-up: 3 req / 10 s per key, keyed by IP). On 1.6.23, a multi-entry XFF chain with notrustedProxiesresolves the client IP tonull, and all null-IP requests collapse into one sharedno-trusted-ipbucket per path — i.e. the entire user base would share 3 sign-ins per 10 seconds. An attacker can force this on any topology by sending a forged XFF header (LB appends the real IP → multi-entry → null), so blank is also a sign-in DoS vector. Set it to the LB/VPC CIDR (+ CDN egress ranges if one fronts the app). Self-hosters: blank remains functional for single-proxy setups; the var is exposed in docker-compose.prod.yml and the Helm chartStaging verification list:
AudienceRestriction/bearerSubjectConfirmationDataare now rejected; audience/recipient must match SP entityID/ACS (per-providersamlConfig.audienceis the escape hatch)TRUSTED_ORIGINS— needs a self-hoster release notetokenUrlredirects (www/apex, region) failsreturnUrlnow validated against trustedOrigins; cancel/restore 400s on subscription rows lackingstripeSubscriptionId(check manually provisioned enterprise rows)Type of Change
Testing
Checklist