High

Better Auth: Unauthenticated API key creation through api-key plugin

  • Disclosed: 09.10.2025
  • Updated: 11.10.2026 10:22

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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package better-auth < 1.3.26 1.3.26

References

CVSS score 8.6/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L
Weakness (CWE)
CWE-285, CWE-306
Platform
npm
Package
better-auth
Disclosed
09.10.2025
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-99h5-pjcv-gr6v - CC BY 4.0

Vulnerability history: better-auth

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (22) in the archive
Total entries
22
First → latest
12.2024 07.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 2
  • High 14
  • Medium 3
  • Low 3

Disclosures per year

  1. 2024: 1
  2. 2025: 8
  3. 2026: 13
Severity:
  1. High · 8.3 CVE-2026-67327 >= 1.1.3, < 1.6.22, >= 1.7.0-beta.0, < 1.7.0-beta.10 1.6.22, 1.7.0-beta.10
  2. High · 8.1 CVE-2026-53517 >= 1.4.8-beta.7, < 1.6.0 1.6.0
  3. High · 7.7 CVE-2026-67333 < 1.6.13, >= 1.7.0-beta.0, < 1.7.0-beta.4 1.6.13, 1.7.0-beta.4
  4. High · 7.3 CVE-2026-45364 < 1.4.17, >= 1.5.0-beta.1, < 1.5.0-beta.9 1.4.17, 1.5.0-beta.9
  5. Better Auth: Unauthenticated API key creation through api-key plugin this entry
    High · 8.6 CVE-2025-61928 < 1.3.26 1.3.26

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.