fix(deps): update dependency better-auth to v1.3.26 [security] #993
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


This PR contains the following updates:
1.1.10->1.3.26GitHub Vulnerability Alerts
GHSA-9x4v-xfq5-m8x5
Summary
The better-auth
/api/auth/errorpage was vulnerable to HTML injection, resulting in a reflected cross-site scripting (XSS) vulnerability.Details
The value of
errorURL parameter was reflected as HTML on the error page: https://github.com/better-auth/better-auth/blob/05ada0b79dbcac93cc04ceb79b23ca598d07830c/packages/better-auth/src/api/routes/error.ts#L81PoC
https://demo.better-auth.com/api/auth/error?error=%3Cscript%3Ealert(1)%3C/script%3E
Impact
An attacker who exploited this vulnerability by coercing a user to visit a specially-crafted URL could execute arbitrary JavaScript in the context of the user's browser.
Because better-auth is a dependency of web applications, the impact of such a vulnerability is unknowable; it depends on the functionality of the application/site using better-auth. I have calculated the CVSS score assuming the hypothetical victim is an administrator with elevated permissions and access.
CVE-2025-27143
Summary
The application is vulnerable to an open redirect due to improper validation of the callbackURL parameter in the email verification endpoint and any other endpoint that accepts callback url. While the server blocks fully qualified URLs (e.g., https://evil.com), it incorrectly allows scheme-less URLs (e.g., //malicious-site.com). This results in the browser interpreting the URL as https://malicious-site.com, leading to unintended redirection.
bypass for : GHSA-8jhw-6pjj-8723
Affected Versions
All versions prior to 1.1.19
Details
The application’s email verification endpoint (/auth/verify-email) accepts a callbackURL parameter intended to redirect users after successful email verification. While the server correctly blocks fully qualified external URLs (e.g., https://evil.com), it improperly allows scheme-less URLs (e.g., //malicious-site.com). This issue occurs because browsers interpret //malicious-site.com as https://malicious-site.com, leading to an open redirect vulnerability.
An attacker can exploit this flaw by crafting a malicious verification link and tricking users into clicking it. Upon successful email verification, the user will be automatically redirected to the attacker's website, which can be used for phishing, malware distribution, or stealing sensitive authentication tokens.
Impact
Phishing & Credential Theft – Attackers can redirect users to a fake login page, tricking them into entering sensitive credentials, which can then be stolen.
Session Hijacking & Token Theft – If used in OAuth flows, an attacker could redirect authentication tokens to their own domain, leading to account takeover.
GHSA-vp58-j275-797x
Summary
A bypass was found for wildcard or absolute URLs trustedOrigins configurations and opens the victims website to a Open Redirect vulnerability, where it can be used to steal the reset password token of a victims account by changing the "callbackURL" parameter value to a website owned by the attacker.
Details
Absolute URLs
The issue here appears in the middleware, specifically. This protection is not sufficiente and it allows attackers to exploit a open redirect vulnerability, by using the payload
/\/example.com. We can check this is a valid URL ( or it will be a valid URL because the URL parser fix it for us ), by checking the image bellow:Regex
The issue here is because the regex is not strong enough
[^/\\]*?\.example\.com[/\\]*?( this is the regex it will be created if we have a wildcard as the trustedOrigins config ), but we can bypass by using a payload like:This works because : and ? are special chars in a URL, so when the URL parser sees, http: it will fix our happily fix our URL to http://attacker.com? and make
.example.comas parameter, thus, bypassing this check.PoC
We can PoC the open redirect by using the
demo.better-auth.com.If we access the URL bellow, we are redirected to example.com:
Impact
Every single website using the better-auth library, is vulnerable to un-auth open redirect and more importantilly, vulnerable to potential one click account take over vulnerability, as the attacker can send the victim a email to reset their account while changing the "redirectTo" parameter here, and when the victim clicks on the link, the reset token is sent to the attackers website, which then a attacker could use that token to reset the password of the victims account.
CVE-2025-53535
Summary
An open redirect has been found in the
originCheckmiddleware function, which affects the following routes:/verify-email,/reset-password/:token,/delete-user/callback,/magic-link/verify,/oauth-proxy-callback.Details
In the
matchesPatternfunction,url.startsWith(can be deceived with aurlthat starts with one of thetrustedOrigins.Open Redirect PoCs
/reset-password/:token/verify-email/delete-user/callback/magic-link/verify/oauth-proxy-callbackImpact
Untrusted open redirects in various routes.
CVE-2025-61928
Summary
Unauthenticated attackers can create or modify API keys for any user by passing that user's id in the request body to the
api/auth/api-key/createroute.Details
The vulnerability exists in the authentication logic at when checking for user authentication then derives the user as
session?.user ?? (authRequired ? null : { id: ctx.body.userId }). When no session exists butuserIdis present in the request body,authRequiredbecomes false and the user object is set to the attacker-controlled ID. Server-only field validation only executes whenauthRequiredis true (lines 280-295), allowing attackers to set privileged fields. No additional authentication occurs before the database operation, so the malicious payload is accepted. The same pattern exists in the update endpoint.PoC
Response contains the new API key whose userId matches the victim, confirming the bypass.
Impact
This is a critical authentication bypass enabling full an unauthenticated attacker can generate an API key for any user and immediately gain complete authenticated access. This allows the attacker to perform any action as the victim user using the api key, potentially compromise the user data and the application depending on the victim's privileges.
This issue was found by ZeroPath.
Release Notes
better-auth/better-auth (better-auth)
v1.3.26Compare Source
🐞 Bug Fixes
View changes on GitHub
v1.3.25Compare Source
🚀 Features
cli- by @Kinfe123 and @himself65 in #4872 (e1082)🐞 Bug Fixes
requestPasswordReset- by @Eazash in #5014 (d6224)null- by @ping-maxwell in #5036 (84e99)getCustomerCreateParamsnot actually being called - by @ebalo55 and @himself65 in #5019 (cdd6f)🏎 Performance
View changes on GitHub
v1.3.24Compare Source
🚀 Features
🐞 Bug Fixes
onDeleteis ignored - by @himself65 in #4973 (aba9a)🏎 Performance
Auth- by @himself65 in #4930 (574b9)View changes on GitHub
v1.3.23Compare Source
v1.3.22Compare Source
v1.3.21Compare Source
v1.3.20Compare Source
v1.3.19Compare Source
🐞 Bug Fixes
getSessionshouldn't exposeoptionsandpathtypes - by @Bekacru in #4947 (633a7)View changes on GitHub
v1.3.18Compare Source
🐞 Bug Fixes
Set-Cookieheader - by @frectonz in #4388 (15b00)View changes on GitHub
v1.3.17Compare Source
🚀 Features
🐞 Bug Fixes
View changes on GitHub
v1.3.16Compare Source
No significant changes
View changes on GitHub
v1.3.15Compare Source
🐞 Bug Fixes
View changes on GitHub
v1.3.14Compare Source
🚀 Features
🐞 Bug Fixes
Math.flooraround the division when calculating TTL - by @DevDuki, Dusan Misic, ping-maxwell and @himself65 in #4768 (08da9)ctxto DB hooks - by @ping-maxwell in #4769 (39c21)beforeCreateOrganization- by @ping-maxwell in #4765 (25a43)View changes on GitHub
v1.3.13Compare Source
🚀 Features
returnHeaderstogetSession- by @frectonz in #3983 (8a4b3)🐞 Bug Fixes
autoCreateOnSignUpoption as it's not implemented yet - by @Bekacru in #4755 (21bd4)emailfrom query - by @himself65 in #4740 (8709a)View changes on GitHub
v1.3.12Compare Source
🚀 Features
generateOTP- by @ping-maxwell in #4723 (11dbf)🐞 Bug Fixes
View changes on GitHub
v1.3.11Compare Source
🚀 Features
🐞 Bug Fixes
errorCallbackURLin failed oauth flows - by @frectonz in #4650 (43545)init- by @LightTab2 and @himself65 in #4680 (9d216)View changes on GitHub
v1.3.10Compare Source
Maintenance update: We fixed lots of issues from the community. Thanks to everyone for contributing to better-auth.
🚀 Features
🐞 Bug Fixes
refreshTokenExpiresAt- by @himself65 in #4569 (cc007)dontRememberMemode - by @frectonz in #4558 (acb28)method- by @himself65 in #4595 (60930)unknownby default - by @himself65 in #4596 (78250)global.crypto- by @himself65 in #4606 (ef450)onMount- by @frectonz in #4669 (9d6e4)infoshows the correct version - by @himself65 in #4547 (7faae)window.cryptois undefined - by @himself65 in #4620 (7dbc5)checkRolePermissionshouldn't be a promise - by @ping-maxwell in #4533 (abfc4)client_secrectfrom authorizationUrl - by @arslan2012 in #4511 (71aeb)View changes on GitHub
v1.3.9Compare Source
🚀 Features
🐞 Bug Fixes
node:sqlite- by @himself65 in #4415 (14ad4)iatfor/tokenendpoint - by @dvanmali in #4501 (8f80a)/api/authfromwwwAuthenticateValueand properly format the header - by @paoloricciuti in #4462 (4b364)base64.encode- by @himself65 in #4527 (4ebc6)client_key- by @Manokii in #4437 (d8145)View changes on GitHub
v1.3.8Compare Source
🚀 Features
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, 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.