Skip to content

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 9, 2025

This PR contains the following updates:

Package Change Age Confidence
better-auth (source) 1.3.8 -> 1.3.26 age confidence

GitHub Vulnerability Alerts

GHSA-99h5-pjcv-gr6v

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/create route.

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 but userId is present in the request body, authRequired becomes false and the user object is set to the attacker-controlled ID. Server-only field validation only executes when authRequired is 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

curl -X POST http://localhost:3000/api/auth/api-key/create \
   -H 'Content-Type: application/json' \
   -d '{
         "userId": "victim-user-id",
         "name": "zeropath"
       }'

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.26

Compare Source

   🐞 Bug Fixes
  • [security] api keys should properly check if a request is from client or server  -  by @​Bekacru (55608)
  • api-key: Shouldn't issue api key a mock session by default  -  by @​Bekacru (a49e5)
    View changes on GitHub

v1.3.25

Compare Source

   🚀 Features
   🐞 Bug Fixes
   🏎 Performance
    View changes on GitHub

v1.3.24

Compare Source

   🚀 Features
   🐞 Bug Fixes
   🏎 Performance
    View changes on GitHub

v1.3.23

Compare Source

v1.3.22

Compare Source

v1.3.21

Compare Source

v1.3.20

Compare Source

v1.3.19

Compare Source

   🐞 Bug Fixes
    View changes on GitHub

v1.3.18

Compare Source

   🐞 Bug Fixes
    View changes on GitHub

v1.3.17

Compare Source

   🚀 Features
   🐞 Bug Fixes
    View changes on GitHub

v1.3.16

Compare Source

No significant changes

    View changes on GitHub

v1.3.15

Compare Source

   🐞 Bug Fixes
    View changes on GitHub

v1.3.14

Compare Source

   🚀 Features
   🐞 Bug Fixes
    View changes on GitHub

v1.3.13

Compare Source

   🚀 Features
   🐞 Bug Fixes
    View changes on GitHub

v1.3.12

Compare Source

   🚀 Features
   🐞 Bug Fixes
    View changes on GitHub

v1.3.11

Compare Source

   🚀 Features
   🐞 Bug Fixes
    View changes on GitHub

v1.3.10

Compare Source

   Maintenance update: We fixed lots of issues from the community. Thanks to everyone for contributing to better-auth.

   🚀 Features
   🐞 Bug Fixes
    View changes on GitHub

v1.3.9

Compare Source

   🚀 Features
   🐞 Bug Fixes
    View changes on GitHub

Configuration

📅 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link

socket-security bot commented Oct 9, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedbetter-auth@​1.3.26991008796100

View full report

@renovate renovate bot force-pushed the renovate/npm-better-auth-vulnerability branch from dd05c46 to c709d2f Compare October 10, 2025 08:01
@renovate renovate bot changed the title fix(deps): update dependency better-auth to v1.3.26 [security] fix(deps): update dependency better-auth to v1.3.26 [security] - autoclosed Oct 11, 2025
@renovate renovate bot closed this Oct 11, 2025
auto-merge was automatically disabled October 11, 2025 15:02

Pull request was closed

@renovate renovate bot deleted the renovate/npm-better-auth-vulnerability branch October 11, 2025 15:02
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.

0 participants