CVE-2025-61928: Better Auth Unauthenticated API Key Creation Through Vulnerability
HIGHCVE-2025-61928 is a HIGH (CVSS 8.6) unauthenticated api key creation through vulnerability (CWE-306: Missing Authentication for Critical Function) affecting Better Auth libraries in the npm ecosystem. The issue involves unauthenticated api key creation through api-key plugin. Remediation is available by upgrading affected packages to version 1.3.26.
CVE-2025-61928 at a Glance
Security Impact
CVSS: 8.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L).
How to Fix CVE-2025-61928
To remediate this vulnerability, upgrade all affected Better Auth dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install better-auth@1.3.26
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls better-auth
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-61928, inspect your project dependencies using npm:
npm ls better-auth
Analyze the terminal output to locate any version of Better Auth in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.26), your application is affected.
Note: The npm ls better-auth command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-306: Missing Authentication for Critical Function, where the product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources. In Better Auth, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-61928 Affected Better Auth Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
better-auth
|
npm |
< 1.3.26
|
1.3.26
|
References
Frequently Asked Questions
What is CVE-2025-61928?
Which Better Auth versions are affected?
What version fixes CVE-2025-61928?
Is better-auth affected?
What is the CVSS score of CVE-2025-61928?
What CWE is associated with CVE-2025-61928?
How can I check npm dependencies for CVE-2025-61928?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-99h5-pjcv-gr6v",
"modified" : "2025-12-09T16:24:49Z",
"published" : "2025-10-09T15:40:50Z",
"aliases" : [ "CVE-2025-61928" ],
"summary" : "Better Auth: Unauthenticated API key creation through api-key plugin",
"details" : "### **Summary**\n\nA critical authentication bypass was identified in the API key creation and update endpoints. An attacker could create or modify API keys for arbitrary users by supplying a victim’s user ID in the request body. Due to a flaw in how the authenticated user was derived, the endpoints could treat attacker-controlled input as an authenticated user object under certain conditions.\n\n### **Details**\n\nThe vulnerability originated from fallback logic used when determining the current user. When no session was present, the handler incorrectly allowed request-body data to populate the user context used for authorization decisions. Because server-side validation only executed when authentication was required, privileged fields were not properly protected. As a result, the API accepted unauthenticated requests that targeted other users.\n\nThis same pattern affected both the API key creation and update routes.\n\n### **Impact**\n\nUnauthenticated attackers could generate or modify API keys belonging to any user. This granted full authenticated access as the targeted user and, depending on the user’s privileges, could lead to account compromise, access to sensitive data, or broader application takeover.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "better-auth"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.3.26"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/better-auth/better-auth/security/advisories/GHSA-99h5-pjcv-gr6v"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-61928"
}, {
"type" : "WEB",
"url" : "https://github.com/better-auth/better-auth/commit/556085067609c508f8c546ceef9003ee8c607d39"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/better-auth/better-auth"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-285", "CWE-306" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-10-09T15:40:50Z",
"nvd_published_at" : "2025-10-09T22:15:32Z"
}
}