better-auth is vulnerable to Improper Authentication
91
CVE Score
Critical
Improper Authentication
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.
Upgrade the better-auth library to the patch version.
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.
1.3.18 - 1.7.6
Fixed in 1.7.7better-auth is vulnerable to Improper Authentication in versions 1.3.18 - 1.7.6.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.