better-auth is vulnerable to Improper Authentication
59
CVE Score
Medium
Improper Authentication
better-auth's OAuth sign-in can treat an unverified provider email as verified. Any non-empty email_verified value, including the string "false", was treated as verified, so someone who can hold another person's address unverified at an affected provider (e.g. Amazon Cognito) can be linked to the local account that owns that address and get a session for it. In addition, generic OAuth did not check that the user info profile's subject matched the ID token's subject, and direct ID-token sign-in could load the profile from a submitted access token, which could attach a different provider identity than the one named in the ID token. The Zoom provider also ignored its configured options, so disableSignUp, requireEmailVerification and overrideUserInfoOnSignIn did not apply.
Upgrade the better-auth library to the patch version. As a workaround for a provider that sends string claims, provide a getUserInfo function that converts email_verified to a boolean. For Zoom, turn off the provider if you rely on the ignored options.
You are affected if you are using a version that falls within the vulnerable range and use OAuth sign-in where any of the following is true: a provider sends email_verified as a string and lets users keep an unverified address (e.g. Amazon Cognito's user info endpoint), you use genericOAuth() with a provider that has a JWKS endpoint, or you use the Zoom provider with disableSignUp, requireEmailVerification or overrideUserInfoOnSignIn. Providers listed in account.accountLinking.trustedProviders are not affected, since linking by email is intended there.
0.4.9 - 1.7.15
Fixed in 1.7.16better-auth is vulnerable to Improper Authentication in versions 0.4.9 - 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.