better-auth is vulnerable to Improper Authentication
81
CVE Score
High
Improper Authentication
The Better Auth phone number plugin lets sign-up and other flows save a phone number on an account before anyone proves they own it, and phone OTP sign-in then selects the account holding that number without requiring phoneNumberVerified. An attacker can store a victim's phone number on an account they control; when the victim later signs in with a valid OTP sent to their own phone, they receive a session for the attacker's account, and data they enter there may be exposed to the attacker. Separately, phone verification codes share an unnamespaced identifier with codes from other flows, so wrong-phone attempts can repeatedly delete another user's pending code and block their sign-in or recovery. The fix rejects phoneNumber in sign-up and sign-in requests, drops unverified numbers from user creation and social profiles, and uses a phone-specific identifier for verification codes.
Upgrade the better-auth library to the patch version. On 1.7.16, also clear previously saved unverified phone numbers (for example, set phoneNumber to NULL where phoneNumberVerified is not true).
You are affected if you are using a version that falls within the vulnerable range and you use the phone number plugin. The shared verification code issue affects versions from 1.2.6 when no custom verifyOTP function is set.
0.4.12 - 1.7.15
Fixed in 1.7.16better-auth is vulnerable to Improper Authentication in versions 0.4.12 - 1.7.15.
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.