Skip to content

Move better-auth to 1.7.27 and patch three locked advisories - #2024

Open
ege-arhan wants to merge 2 commits into
CopilotKit:mainfrom
ege-arhan:fix/locked-dependency-advisories
Open

ege-arhan wants to merge 2 commits into
CopilotKit:mainfrom
ege-arhan:fix/locked-dependency-advisories

Conversation

@ege-arhan

Copy link
Copy Markdown

What this changes

Addresses #1987.

The issue's author offered to open this same PR. Nothing came of it in the day
since, so here is the four-version bump they described, with the lockfile
regenerated and the checks below run. Take theirs instead if they send it.

The locked versions in bun.lock carried four advisories that all have a fixed
release. This moves the four and re-locks them; no call site changes.

  • better-auth 1.7.1 → 1.7.27. GHSA-965c-763c-88jm (CRITICAL: an OAuth state can
    be used as a magic link to sign in as another person) and GHSA-r4xp-prcw-77qf
    (HIGH, OAuth Proxy) are fixed in 1.7.7. The app uses Generic OAuth for Okta and
    SSO, so both app and mobile move, and the family is re-locked together: core,
    sso, expo and the adapters.
  • @modelcontextprotocol/sdk 1.30.0 → 1.32.0. GHSA-6qxp-vccf-f47h (an MCP server
    could choose the authorization server that receives the stored refresh token and
    client secret) and GHSA-f897-62hf-6gxq (HTTP transports did not bound the request
    body).
  • seroval 1.6.3 → 1.6.11. GHSA-7rv5-mrxv-xcr9, GHSA-97r2-qh9m-474h.
  • lodash-es 4.18.0 → 4.18.1. GHSA-f23m-r3pf-42rh, and the root overrides was
    pinning the vulnerable version itself.

bun install regenerates the lockfile; bun.lock is the only other file.

Where it runs

  • New state that outlives a request? None.
  • What happens on the second replica? Nothing different; this is a version bump.
  • Anything serialised? No.
  • Anything fanned out to a browser? No.
  • New listener, port, or schedule? No.

Boundary and audit

  • Every acting call still goes through the gateway: resolve, decide, audit, then act. No call site changed.
  • New refusals and new failures each write a row. None added.
  • Nothing new is trusted from the client that the server can resolve itself.

Changelog

A deployment that upgrades now runs the patched better-auth, so sign-in behaves
differently for the two OAuth advisories above. I did not add a line under
Unreleased because the last dependency bump for an advisory (#1809,
fast-xml-parser → 5.12.1) shipped without one. Say the word and I will add it.

Proof

On this branch, at 66a11dc:

$ bun install
Resolved, downloaded and extracted [116]
Saved lockfile
55 packages installed [2.21s]

$ bun run --filter app typecheck
Exited with code 0

$ bun run format:check
Checked 4703 files in 492ms. No fixes applied.

$ bun run lint
Checked 2350 files in 808ms. No fixes applied.

$ bun test shared
 512 pass
 0 fail
 1846 expect() calls
Ran 512 tests across 44 files. [4.64s]

bun run typecheck over every workspace needs more than the default Node heap:
app aborted with Ineffective mark-compacts near heap limit at 2 GB. With
NODE_OPTIONS=--max-old-space-size=6144 it passes. That is the same on main
before this branch, so it is not something this change introduces.

mobile has no typecheck script registered as a workspace package, so its types
were not checked here; the only change in it is four version strings.

I did not run the full bun test suite (the app tests need a running server) and
did not run an end-to-end sign-in against Okta or an SSO provider.

`better-auth` 1.7.1 is affected by GHSA-965c-763c-88jm (CRITICAL: an OAuth state
can be used as a magic link to sign in as another person) and
GHSA-r4xp-prcw-77qf (HIGH, OAuth Proxy). Both are fixed in 1.7.7. The app uses
Generic OAuth for Okta and SSO, so this moves the app and mobile pins to 1.7.27
and re-locks the family together: core, sso, expo and the adapters.

The lockfile also carried three other advisories with a fixed release:

- `@modelcontextprotocol/sdk` 1.30.0 → 1.32.0 (GHSA-6qxp-vccf-f47h: an MCP
  server could choose the authorization server that receives the stored
  refresh token and client secret; GHSA-f897-62hf-6gxq: HTTP transports did not
  bound the request body).
- `seroval` 1.6.3 → 1.6.11 (GHSA-7rv5-mrxv-xcr9, GHSA-97r2-qh9m-474h).
- `lodash-es` 4.18.0 → 4.18.1 (GHSA-f23m-r3pf-42rh), which the root overrides
  pinned at the vulnerable version.

Only versions and the lockfile move; no call site changes.

Signed-off-by: ege-arhan <egearhany@gmail.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T14:54:48.636146Z 66a11dc PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 66a11dc69a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread mobile/package.json
Comment on lines +14 to +15
"@better-auth/expo": "1.7.27",
"@better-auth/sso": "1.7.27",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Regenerate the standalone mobile npm lockfile

The native types job in .github/workflows/ci.yml:304-309 installs mobile with npm ci --prefix mobile --ignore-scripts, but mobile/package-lock.json still records all four upgraded Better Auth packages at 1.7.1. The npm ci documentation states that when locked dependencies do not match the manifest, “npm ci will exit with an error, instead of updating the package lock,” so this job cannot reach typechecking. Mobile is explicitly outside the Bun workspaces; regenerate and commit its separate npm lockfile as part of this upgrade.

Useful? React with 👍 / 👎.

Comment thread mobile/package.json
"@better-auth/core": "1.7.1",
"@better-auth/expo": "1.7.1",
"@better-auth/sso": "1.7.1",
"@better-auth/core": "1.7.27",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Align the mobile fetch pin with the upgraded auth peers

For the standalone mobile npm install, the unchanged direct @better-fetch/fetch pin at 1.3.1 conflicts with the exact 1.3.3 peer required by the newly selected @better-auth/core and @better-auth/sso, as shown in their updated bun.lock entries. npm's peer-dependency documentation notes that a “conflicting requirement may cause an error if the tree cannot be resolved correctly”; an in-memory check with npm's resolver confirms ERESOLVE for these pins, while the previous versions resolve successfully. Independently of the stale lockfile, update or remove the direct fetch pin so the mobile dependency tree can resolve.

Useful? React with 👍 / 👎.

mobile/ is outside the bun workspaces, so its separate npm lockfile still
pinned better-auth at 1.7.1 and would fail the native types job's npm ci.
Regenerated it and bumped the direct @better-fetch/fetch pin to 1.3.3, which
the upgraded @better-auth/core and @better-auth/sso peers require.

Verified: npm ci --prefix mobile --ignore-scripts, npx tsc --noEmit (mobile).

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