better-auth is vulnerable to Improper Authorization
68
CVE Score
Medium
Improper Authorization
better-auth's admin /admin/update-user endpoint requires a separate user:set-email permission to change a user's email address, but passes the phoneNumber and phoneNumberVerified fields through with only the general user:update permission. A user with a limited role that holds user:update can put their own phone number, marked as verified, on another user's account and then sign in to that account with a phone OTP, taking over the victim's session, including accounts with more privileges than their own. The fix requires a new user:set-phone permission whenever either phone field is present in the request.
Upgrade the better-auth library to the patch version. Changing phoneNumber or phoneNumberVerified through update-user now requires the new user:set-phone permission, which the default admin role has. If you use custom access control, add set-phone to your statements and grant it to the roles that should be allowed to change phone numbers.
You are affected if you are using a version that falls within the vulnerable range, you use both the admin plugin and the phone number plugin, and a role other than the full admin role holds the user:update permission. You are not affected if only full administrators can update users.
0.0.1 - 1.7.15
Fixed in 1.7.16better-auth is vulnerable to Improper Authorization in versions 0.0.1 - 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.