better-auth is vulnerable to Improper Authentication
91
Critical Risk
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.
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.
better-auth is vulnerable to Improper Authentication in versions 1.3.18 - 1.7.6.
Upgrade the better-auth library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

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.