CVE-2025-61928 Details
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.
A critical authentication bypass vulnerability has been identified in Better Auth, an authentication and authorization library for TypeScript, affecting versions prior to 1.3.26. The issue allows unauthenticated attackers to create or modify API keys for any user by including the user's ID in the request body to the 'api/auth/api-key/create' route. The vulnerability arises because the authentication logic incorrectly processes requests without a session but with a user ID, enabling attackers to manipulate privileged fields. This flaw is also present in the API key update endpoint.
Users can update to Better Auth version 1.3.26 or later, where this vulnerability has been patched.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Oct 9, 2025CISA-ADP
Assessed Oct 10, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/better-auth/better-auth/security/advisories/GHSA-99h5-pjcv-gr6v | CISA-ADP | AdvisoryExploitRemedyVendor |
| https://github.com/better-auth/better-auth/commit/556085067609c508f8c546ceef9003ee8c607d39 | [email protected] | Source CodeVendor |
| https://github.com/better-auth/better-auth/security/advisories/GHSA-99h5-pjcv-gr6v | [email protected] | AdvisoryExploitRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-285 | Improper Authorization | [email protected] |
| CWE-306 | Missing Authentication for Critical Function | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| Better Auth | < 1.3.26 (semver) |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 19, 2026 | CVE Translated | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Oct 10, 2025 | CVE Modified | CISA-ADP |
| Oct 9, 2025 | New CVE Received | [email protected] |
Volerion