CVE-2025-61928: Better Auth Unauthenticated API Key Creation Through Vulnerability

HIGH
Advisory Identifier: GHSA-99h5-pjcv-gr6v
CVSS 8.6
CWE-306 CWE-285
Published
Advisory Summary

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

CVE Identifier CVE-2025-61928
GHSA Identifier GHSA-99h5-pjcv-gr6v
Severity HIGH
CVSS v3.1 Base Score 8.6
CWE Classification CWE-306: Missing Authentication for Critical Function
Affected Product Better Auth
Package Ecosystem npm
Published Date
Last Updated

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability Low (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.

better-auth fixed: 1.3.26
npm install better-auth@1.3.26
Verify Direct and Transitive Dependencies

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

### **Summary** A 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. ### **Details** The 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. This same pattern affected both the API key creation and update routes. ### **Impact** Unauthenticated 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.

CVE-2025-61928 Affected Better Auth Versions

1 component(s)
Fixed Versions:
1.3.26
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?
CVE-2025-61928 is a security vulnerability in Better Auth involving Unauthenticated API key creation through api-key plugin under CWE-306: Missing Authentication for Critical Function.
Which Better Auth versions are affected?
Affected versions include releases prior to 1.3.26 across affected packages: better-auth.
What version fixes CVE-2025-61928?
Upgrading to 1.3.26 (or the latest patched release for your respective branch) resolves the vulnerability.
Is better-auth affected?
Yes, better-auth is affected in releases prior to 1.3.26. Upgrade your dependency to 1.3.26 or later.
What is the CVSS score of CVE-2025-61928?
CVE-2025-61928 has a CVSS v3.1 base score of 8.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L.
What CWE is associated with CVE-2025-61928?
CVE-2025-61928 is classified under CWE-306: Missing Authentication for Critical Function (The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.).
How can I check npm dependencies for CVE-2025-61928?
Run the dependency tree command: 'npm ls better-auth'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}