chore(deps): update dependency better-auth to ^1.3.4 [security]#1228
chore(deps): update dependency better-auth to ^1.3.4 [security]#1228renovate[bot] wants to merge 1 commit intomainfrom
Conversation
|
81c1c6b to
318632d
Compare
4a347e0 to
98cf683
Compare
ac0b1cb to
270d4ec
Compare
6bdfd7a to
9b6b3b1
Compare
9b6b3b1 to
52e2e3a
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA single dependency version change: Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@examples/react/projects/package.json`:
- Line 29: Update the better-auth dependency in the manifest from "^1.3.4" to
"^1.4.5" so the package.json floor addresses GHSA-x732-6j76-qmhm and the other
advisories, then regenerate the lockfile (npm/yarn/pnpm lock) so the lock
reflects a single resolved version (remove/replace the 1.3.4 entry and ensure
only the 1.4.x entry, e.g., 1.4.18, is present); target the package.json
"better-auth" entry and the repo lockfile(s) to keep them consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0c4eedec-9564-4ff0-aba8-2d4712748df8
📒 Files selected for processing (1)
examples/react/projects/package.json
| "@trpc/client": "^11.10.0", | ||
| "@trpc/server": "^11.10.0", | ||
| "better-auth": "^1.4.18", | ||
| "better-auth": "^1.3.4", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify manifest vs lockfile spec and resolved entries for better-auth
rg -n '"better-auth"\s*:' examples/react/projects/package.json
fd pnpm-lock.yaml --exec rg -n 'better-auth(@|:)' {}Repository: TanStack/db
Length of output: 318
🌐 Web query:
What are the patched version ranges for better-auth for CVE-2025-61928, GHSA-569q-mpph-wgww, and GHSA-x732-6j76-qmhm, and do they require >=1.4.5?
💡 Result:
| Vulnerability | Vulnerable (affected) better-auth versions | Patched / fixed better-auth versions | Requires >= 1.4.5? |
|---|---|---|---|
| CVE-2025-61928 | < 1.3.26 |
>= 1.3.26 |
No (1.3.26 is sufficient) [1] |
| GHSA-569q-mpph-wgww | < 1.4.2 |
>= 1.4.2 |
No (1.4.2 is sufficient) [2] |
| GHSA-x732-6j76-qmhm | < 1.4.5 |
>= 1.4.5 |
Yes [3] |
If you upgrade to better-auth >= 1.4.5, you’ll be patched for all three. [3]
Sources: [1] [2] [3]
Keep better-auth ≥ 1.4.5 to fix all three advisories; resolve lockfile mismatch.
At Line 29, the change to ^1.3.4 introduces a regression. While this floor fixes CVE-2025-61928 (patched ≥ 1.3.26) and GHSA-569q-mpph-wgww (patched ≥ 1.4.2), it leaves GHSA-x732-6j76-qmhm vulnerable (requires ≥ 1.4.5). Given the PR explicitly references these advisories, the version floor should be at least ^1.4.5.
Additionally, the lockfile currently contains both 1.4.18 and 1.3.4 entries but the manifest specifies ^1.3.4, causing misalignment that must be resolved.
Proposed fix
- "better-auth": "^1.3.4",
+ "better-auth": "^1.4.5",Then regenerate the lockfile to match.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "better-auth": "^1.3.4", | |
| "better-auth": "^1.4.5", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@examples/react/projects/package.json` at line 29, Update the better-auth
dependency in the manifest from "^1.3.4" to "^1.4.5" so the package.json floor
addresses GHSA-x732-6j76-qmhm and the other advisories, then regenerate the
lockfile (npm/yarn/pnpm lock) so the lock reflects a single resolved version
(remove/replace the 1.3.4 entry and ensure only the 1.4.x entry, e.g., 1.4.18,
is present); target the package.json "better-auth" entry and the repo
lockfile(s) to keep them consistent.
52e2e3a to
0b5a3ef
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
examples/react/projects/package.json (1)
29-29:⚠️ Potential issue | 🔴 CriticalBlock this security-floor downgrade for
better-auth.At Line 29, changing to
^1.3.4weakens the minimum version in a security PR and leaves CI broken due to manifest/lockfile mismatch (^1.3.4vs^1.4.18). Keep the floor at^1.4.5or higher and regenerate the lockfile so both are aligned.Proposed fix
- "better-auth": "^1.3.4", + "better-auth": "^1.4.5",#!/bin/bash # Verify manifest value + lockfile alignment for better-auth (read-only). rg -n '"better-auth"\s*:' examples/react/projects/package.json fd 'pnpm-lock.yaml|package-lock.json|yarn.lock' -t f --exec rg -n 'better-auth(@|:)|"better-auth"\s*:'What are the patched version ranges for better-auth advisories CVE-2025-61928, GHSA-569q-mpph-wgww, and GHSA-x732-6j76-qmhm, and which minimum version fixes all three?🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/react/projects/package.json` at line 29, The PR lowered the minimum allowed version for the dependency "better-auth" from the security floor ^1.4.5 to ^1.3.4, causing a manifest/lockfile mismatch and weakening security; revert the package.json entry for "better-auth" to ^1.4.5 (or a higher patched minimum) and regenerate the repository lockfile for the project's package manager (pnpm/yarn/npm) so the lockfile and manifest match, then run an install to update the lockfile and commit both updated package.json and the regenerated lockfile to the branch so CI is consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@examples/react/projects/package.json`:
- Line 29: The PR lowered the minimum allowed version for the dependency
"better-auth" from the security floor ^1.4.5 to ^1.3.4, causing a
manifest/lockfile mismatch and weakening security; revert the package.json entry
for "better-auth" to ^1.4.5 (or a higher patched minimum) and regenerate the
repository lockfile for the project's package manager (pnpm/yarn/npm) so the
lockfile and manifest match, then run an install to update the lockfile and
commit both updated package.json and the regenerated lockfile to the branch so
CI is consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 23adf980-1538-43ce-8237-b1825d890257
📒 Files selected for processing (1)
examples/react/projects/package.json
0b5a3ef to
6cf20e9
Compare
This PR contains the following updates:
^1.4.18→^1.3.4GitHub Vulnerability Alerts
CVE-2025-61928
Summary
A critical authentication bypass was identified in the API key creation and update endpoints. An attacker could create or modify API keys for arbitrary users by supplying a victim’s user ID in the request body. Due to a flaw in how the authenticated user was derived, the endpoints could treat attacker-controlled input as an authenticated user object under certain conditions.
Details
The vulnerability originated from fallback logic used when determining the current user. When no session was present, the handler incorrectly allowed request-body data to populate the user context used for authorization decisions. Because server-side validation only executed when authentication was required, privileged fields were not properly protected. As a result, the API accepted unauthenticated requests that targeted other users.
This same pattern affected both the API key creation and update routes.
Impact
Unauthenticated attackers could generate or modify API keys belonging to any user. This granted full authenticated access as the targeted user and, depending on the user’s privileges, could lead to account compromise, access to sensitive data, or broader application takeover.
GHSA-569q-mpph-wgww
Summary
Affected versions of Better Auth allow an external request to configure
baseURLwhen it isn’t defined through any other means. This can be abused to poison the router’s base path, causing all routes to return 404 for all users.This issue is only exploitable when
baseURLis not explicitly configured (e.g.,BETTER_AUTH_URLis missing) and the attacker is able to make the very first request to the server after startup. In properly configured environments or typical managed hosting platforms, this fallback behavior cannot be reached.Details
A combination of
X-Forwarded-HostandX-Forwarded-Protois implicitly trusted. This allows the first request to configure baseURL whenever it is not explicitly configured.Here's the code that reads the headers:
Here's the call to
getBaseURL(), the result is assigned toctx.baseURL.Here's the router receiving the poisoned
basePath:X-Forwarded-HostandX-Forwarded-Protocan be used to modify the pathname of a parsed URL object which formsbaseURL.basePathis then derived from the pathname ofbaseURL. Once the routerbasePathis poisoned it fails to match & route incoming requests.Repro
Start a better-auth server with no
baseURLconfiguration.Send the following request as the first request to the server:
The better-auth API check endpoint returns 404.
Now send a regular request without the
X-Forwarded-ProtoandX-Forwarded-Hostheaders.The better-auth API check endpoint still returns 404.
Example result
We have modified the
basePathfor the router until the server is restarted. An attacker can repeatedly send these attack requests aiming to persistently exploit the vulnerability.GHSA-x732-6j76-qmhm
Summary
An issue in the underlying router library rou3 can cause
/pathand//pathto be treated as identical routes. If your environment does not normalize incoming URLs (e.g., by collapsing multiple slashes), this can allow bypasses ofdisabledPathsand path-based rate limits.Details
Better Auth uses better-call, which internally relies on rou3 for routing. Affected versions of rou3 normalize paths by removing empty segments. As a result:
/sign-in/email//sign-in/email///sign-in/email…all resolve to the same route.
Some production setups automatically collapse multiple slashes. This includes:
In these environments and other configurations where
//pathreach Better Auth as/path, the issue does not apply.Fix
Updating rou3 to the latest version resolves the issue:
"rou3": "^0.5.1"(commit: https://github.com/h3js/rou3/commit/f60b43fa648399534507c9ac7db36d705b8874c3)
Better Auth recommends:
Impact
disabledPathsThe impact of bypassing disabled paths could vary based on a project's configuration.
Release Notes
better-auth/better-auth (better-auth)
v1.4.5Compare Source
v1.4.4Compare Source
🚀 Features
🐞 Bug Fixes
View changes on GitHub
v1.4.3Compare Source
🚀 Features
🐞 Bug Fixes
View changes on GitHub
v1.4.2Compare Source
🚀 Features
/authforauth.ts- by @ping-maxwell in #6273 (53a74)🐞 Bug Fixes
View changes on GitHub
v1.4.1Compare Source
🚀 Features
🐞 Bug Fixes
generate-authenticate-optionsfrom POST to GET - by @mburumaxwell in #6199 (f922c)View changes on GitHub
v1.4.0Compare Source
🚀 Features
returnHeaderstogetSession- by @frectonz in #3983 (19d4b)storeStateStrategy- by @himself65 and Copilot in #5470 (b5f3b)search_pathconfiguration - by @okisdev in #5449 (bef33)getAdapter- by @himself65 in #5722 (10249)better-auth/minimal- by @bytaesu and @Bekacru in #5704 (1ebc6)cli- by @Kinfe123 and @himself65 in #4872 (70cb4)AuthClient- by @himself65 in #5815 (7caa2)disableSignalclient option - by @ping-maxwell in #6108 (f4c43)@standard-schema/spec- by @himself65 in #5629 (36315)generateOTP- by @ping-maxwell in #4723 (8ac4f)StripePlugintype - by @himself65 in #5509 (34431)🐞 Bug Fixes
Math.flooraround the division when calculating TTL - by @DevDuki, Dusan Misic, ping-maxwell and @himself65 in #4768 (14b9e)requestPasswordReset- by @Eazash in #5014 (2f94b)options.advanced.generateIdtype - by @himself65 (48249)node:async_hooksdirectly - by @himself65 in #5198 (0717e)whereof type TwoFactorWhereUniqueInput needs at least one ofidarguments - by @AlexStrNik in #5180 (2dab4)exactOptionalPropertyTypes- by @Kinfe123 and @himself65 in #5236 (f2723)ssoClientexport from client plugin - by @Kinfe123 in #5307 (ee229)HookEndpointContextandInternalContext- by @himself65 in #5359 (89475)shatobranchand made itcanaryby default - by @max-programming in #5491 (5bc26)deleteUser- by @ping-maxwell in #5553 (216dc)undefinedtype for optional property types - by @himself65 in #5654 (b6d40)string[]inference for additionalFields - by @GautamBytes in #5778 (414d0)ctxoverrequestin plugin options - by @ping-maxwell in #5944 (448d7)identityinstead ofserialfor pg schema - by [@ping-maxwell](https://redirect.github.com/pConfiguration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.