CVE-2025-61928
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-10-09

Last updated on: 2025-10-14

Assigner: GitHub, Inc.

Description
Better Auth is an authentication and authorization library for TypeScript. In versions prior to 1.3.26, 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. `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. 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. Version 1.3.26 contains a patch for the issue.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-10-09
Last Modified
2025-10-14
Generated
2026-05-06
AI Q&A
2025-10-10
EPSS Evaluated
2026-05-05
NVD
Affected Vendors & Products
Showing 2 associated CPEs
Vendor Product Version / Range
better-auth better-auth 1.3.26
better-auth better-auth 1.3.25
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-285 The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.
CWE-306 The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability in Better Auth versions prior to 1.3.26 allows unauthenticated attackers to create or modify API keys for any user by supplying that user's ID in the request body to certain API endpoints. Because the system incorrectly sets authentication requirements based on the presence of a userId in the request body rather than a valid session, attackers can bypass authentication checks and set privileged fields without proper validation. This leads to a critical authentication bypass where attackers can generate API keys for any user and gain full authenticated access as that user.


How can this vulnerability impact me? :

An attacker exploiting this vulnerability can generate API keys for any user without authentication, allowing them to perform any action as the victim user. This can lead to unauthorized access to sensitive user data, manipulation of user accounts, and potentially full compromise of the application depending on the victim's privileges.


What immediate steps should I take to mitigate this vulnerability?

Upgrade Better Auth to version 1.3.26 or later, which contains a patch for this critical authentication bypass vulnerability.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart