Skip to content

Conversation

@renovate
Copy link

@renovate renovate bot commented Oct 9, 2025

This PR contains the following updates:

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

GitHub Vulnerability Alerts

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/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

Configuration

📅 Schedule: Branch creation - "" in timezone America/New_York, Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Never, 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.

@rmolinamir rmolinamir self-assigned this Oct 24, 2025
@rmolinamir rmolinamir added the bug Something isn't working label Oct 24, 2025
@renovate renovate bot force-pushed the renovate/npm-better-auth-vulnerability branch from 0b036f6 to c70f577 Compare October 24, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants