Intel

AIKIDO-2026-373183

better-auth is vulnerable to Improper Authentication

Improper AuthenticationGHSA-965c-763c-88jm Published 5 days ago

91

Critical Risk

This Affects:

JSbetter-auth
1.3.18 - 1.7.6
Fixed in 1.7.7
Are you affected? Scan for Free

TL;DR

Better Auth stores Magic Link tokens and OAuth/SAML state kept in the database as verification records under a shared, unnamespaced identifier, so a value issued for one purpose can be read back through the other flow's lookup. A party who knows a user's email address can start an OAuth sign-in to obtain a state value, then redeem that value through the Magic Link callback as if it were a Magic Link token, without controlling the target mailbox. Where sign-up is permitted, the resulting account is marked as having a verified email, which can escalate trust elsewhere in the application. The fix namespaces each verification record by purpose and validates its type tag before it is consumed.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you enable Magic Link together with a social or Generic OAuth provider whose sign in state is stored in the database.

Background info

better-auth is vulnerable to Improper Authentication in versions 1.3.18 - 1.7.6.

How to fix this

Upgrade the better-auth library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform