Skip to content

build(deps): bump better-auth from 1.6.13 to 1.7.17 - #37

Open
superbot-helper wants to merge 1 commit into
context-dot-dev:mainfrom
superbot-helper:security/bump-better-auth-1.7.17
Open

superbot-helper wants to merge 1 commit into
context-dot-dev:mainfrom
superbot-helper:security/bump-better-auth-1.7.17

Conversation

@superbot-helper

Copy link
Copy Markdown
  • Verified against main at c966d091932311e0a966272be432a0f9e4054f54 (the repository's default branch)
  • Read README.md (the repository has no CONTRIBUTING.md, .github/ directory or PR template)
  • Tested locally (commands and results below)

Bumps better-auth from 1.6.13 to 1.7.17. The manifest range
("better-auth": "^1.6.13", package.json:31) already permits 1.7.x, so this
is a lockfile-only change: package-lock.json is the only file touched, with
no manifest or source edit.

1.6.13 is below the patched version of 13 published advisories against
better-auth and the adapter packages it bundles. 1.7.17 is the current
latest release and is above all of their patched versions (1.6.22,
1.7.0-rc.3, 1.7.7, 1.7.16), so it clears every one.

Advisories visible in the global database

npm audit and the npm bulk advisory feed already flag better-auth@1.6.13
for these four. All four are fixed by 1.7.17.

Advisory Package Affected Patched Severity Global DB
GHSA-qq9h-g4jm-xgf3 better-auth >=1.1.3 <1.6.22 1.6.22 high, CVSS 8.3 yes
GHSA-q84f-53jg-9ppm better-auth >=1.3.8-beta.3 <1.7.0-rc.3 1.7.0-rc.3 high, CVSS 8.1 yes
GHSA-r4xp-prcw-77qf better-auth >=1.5.0-beta.12 <1.7.7 1.7.7 high, CVSS 7.4 yes
GHSA-965c-763c-88jm better-auth >=1.4.0-beta.18 <1.7.7 1.7.7 critical, CVSS 9.1 yes (CVE-2026-114607)

Repository-only advisories

These nine are published in better-auth/better-auth's own advisory database
but are absent from the global database and OSV (all 404 from
api.github.com/advisories and api.osv.dev/v1/vulns/), so no dependency
scanner has a record to match. All nine are fixed by 1.7.17.

Advisory Package Affected Patched Severity
GHSA-4wq4-2ppv-q3hg better-auth <1.7.16 1.7.16 critical, CVSS 9.1
GHSA-q747-mqgr-4gh7 better-auth >=0.4.12-beta.7 <1.7.16 1.7.16 high, CVSS 8.1
GHSA-g95c-wqvr-8c3j better-auth <1.7.16 1.7.16 medium, CVSS 6.8
GHSA-48c2-w96j-mv3m better-auth (<1.7.16), @better-auth/drizzle-adapter, @better-auth/kysely-adapter (>=1.5.0-beta.9 <1.7.16) see package 1.7.16 medium, CVSS 6.8
GHSA-hwq2-v29r-p69r better-auth >=1.4.0 <1.7.16 1.7.16 medium, CVSS 6.4
GHSA-9hm7-xhfp-cx58 better-auth >=0.4.9 <1.7.16 1.7.16 medium, CVSS 5.9
GHSA-c85h-5mrr-mgx4 better-auth >=1.5.5 <1.7.16 1.7.16 medium, CVSS 4.9
GHSA-2f9c-7xj7-gh55 better-auth >=1.3.7 <1.7.16 1.7.16 medium, CVSS 4.8
GHSA-fvxx-76fc-893x better-auth >=0.8.1-beta.5 <1.7.16 1.7.16 medium, CVSS 4.2

@better-auth/sso is a separate plugin package that this repository does not
install: no better-auth plugin package is in the lockfile, only the
@better-auth/{core,telemetry,utils,drizzle-adapter,kysely-adapter,memory-adapter,mongo-adapter,prisma-adapter}
packages that better-auth itself depends on. The SSO advisories
GHSA-8c5h-wx78-2cfg, GHSA-prpr-5gj3-qqhg and GHSA-mx9r-x6ww-qjw9 therefore do
not apply here.

Which advisories this clears: all 13 above.

What this does

Two criticals and four highs are among the 13:

  • GHSA-965c-763c-88jm: an OAuth state value can be replayed as a Magic Link
    token to sign in as another user.
  • GHSA-4wq4-2ppv-q3hg: the Expo authorization proxy can sign values it did not
    issue.
  • GHSA-qq9h-g4jm-xgf3: pre-account hijacking on magic-link and email-OTP
    sign-in — an attacker who registers an address first keeps a working
    password after the real owner signs in with the link or code.
  • GHSA-q84f-53jg-9ppm: device-login approval does not show the requesting
    client or its permissions.
  • GHSA-r4xp-prcw-77qf: the OAuth Proxy plugin can let an attacker sign in as
    another user.
  • GHSA-q747-mqgr-4gh7: phone numbers can be claimed before they are verified.

The remaining seven are medium-severity issues in admin roles, OAuth sign-in,
email change, organization invites, email OTP, secondary session storage and
the MySQL adapters; the table lists them.

Reachability in webdog

src/lib/auth.ts:187-209 configures Better Auth with only:

  • drizzleAdapter(db, { provider: "pg" }) — PostgreSQL;
  • emailAndPassword: { enabled: true, minPasswordLength: 8 };
  • 30-day database-backed sessions.

No plugins are registered (the betterAuth({...}) call has no plugins
array), and no social/OAuth provider is configured. The app uses only
signIn.email / signUp.email / signOut
(src/app/sign-in/form.tsx:28, src/app/sign-up/form.tsx:29,
src/components/header-user-menu.tsx:53).

The affected flows are not enabled: magic link and email OTP, OAuth and the
OAuth proxy, device login, phone number, admin roles, the organization plugin,
the Expo proxy, MySQL adapters, secondary session storage and the cookie
cache. user.changeEmail is not configured either, so the change-email
endpoint returns EMAIL_CHANGE_DISABLED. No advisory above is demonstrably
reachable in webdog's current configuration. This PR is dependency hygiene and
defense-in-depth: it removes 13 affected releases before any of those flows is
turned on.

Change

  • package-lock.json only: better-auth 1.6.13 → 1.7.17, together with the
    @better-auth/{core,drizzle-adapter,kysely-adapter,memory-adapter,mongo-adapter,prisma-adapter,telemetry}
    1.7.17 packages it bundles, better-call 1.3.5 → 1.4.5,
    @better-auth/utils 0.4.1 → 0.5.1, and their supporting dependencies.
  • 17 package names change, all reachable only through better-auth's dependency
    subtree (verified by listing every dependent of each changed entry):
    better-auth, the eight @better-auth/* packages above, better-call,
    @better-auth/utils, @better-fetch/fetch, @noble/hashes, jose,
    nanostores, rou3, set-cookie-parser, and the nested zod 4.x that
    better-auth requires (the root zod 3.x entry is untouched).
  • No entries added; one transitive entry removed
    (@opentelemetry/semantic-conventions 1.42.0, no longer a dependency of
    @better-auth/core 1.7.17).
  • lockfileVersion: 3 unchanged; package.json unchanged.

Verification performed

Environment: macOS arm64, Node 26.13.0, npm 11.20.0. The repository has no
packageManager field and ships a package-lock.json, so npm is its own
package manager.

  • Control — fresh clone of main at c966d091932311e0a966272be432a0f9e4054f54:
    npm ci exit 0 (419 packages); npm run typecheck exit 0; npm run lint
    exit 0 with 10 pre-existing warnings; the repository's only test file
    (src/lib/ai-alert-triage.test.ts, 12 tests) passes; npm run build exit 0.
    npm audit --omit=dev reports 12 vulnerabilities (2 critical), including
    better-auth critical with the four global advisories above.
  • Branch — the same clone with only package-lock.json changed:
    npm update better-auth (npm 11.20.0) resolves better-auth@1.7.17,
    @better-auth/*@1.7.17, better-call@1.4.5 and
    @better-auth/utils@0.5.1; npm run typecheck exit 0; npm run lint
    0 errors with the same 10 warnings; the same 12 tests pass; npm run build
    exit 0; npm audit --omit=dev reports 11 vulnerabilities (1 critical) — the
    better-auth entry is gone, and the remaining findings are pre-existing in
    other dependencies.
  • Fresh clone — fresh clone of main, replace only package-lock.json
    with the updated file: npm ci exit 0, then typecheck, lint, the 12 tests
    and npm run build all pass as above. git status after the install shows
    only the expected package-lock.json modification.
  • Lock control — npm install --package-lock-only on the unmodified
    main checkout reports "up to date" and produces a zero-byte diff, so the
    lock diff above comes only from the bump and not from the npm version.
  • Resolved tree — npm ls better-auth resolves a single
    better-auth@1.7.17; npm ls --all exits 0 and its only unmet entries are
    optional dependencies (platform-specific esbuild binaries, database and
    cloud adapters), which npm does not treat as errors.

How should this be manually tested?

npm ci
npm run typecheck
npm run lint
npm run build
# sign-up, sign-in and sign-out, then a session-gated dashboard request

Scan delta and why this is not a Dependabot PR

This branch has not been deployed

No deployments
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.

1 participant