Improper Authentication Affecting better-auth package, versions >=1.5.0-beta.12 <1.7.7


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.29% (20th 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 Improper Authentication vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-BETTERAUTH-21181488
  • published18 Oct 2026
  • disclosed15 Oct 2026
  • creditiabdullah215, martinfrancois

Introduced: 15 Oct 2026

NewCVE-2026-110864  (opens in a new tab)
CWE-287  (opens in a new tab)

How to fix?

Upgrade better-auth to version 1.7.7 or higher.

Overview

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

Affected versions of this package are vulnerable to Improper Authentication via cross-purpose reuse of verification records, where a token issued for one authentication flow (such as OAuth state or OAuth proxy) can be submitted to the magic-link verification endpoint to obtain a session. The magic-link handler previously looked up verification records by the raw stored token without a type discriminator, allowing an attacker who possesses a valid token from a different flow to authenticate as the associated user. The fix introduces purpose-scoped identifiers (prefixed with magic-link:) and a strict record schema check that rejects records not carrying type: "magic-link", and derives per-purpose encryption keys for OAuth flows using HKDF to prevent ciphertext reuse across contexts.

CVSS Base Scores

version 4.0
version 3.1