better-auth is vulnerable to Privilege Escalation
49
CVE Score
Medium
Privilege Escalation
better-auth's organization plugin prevents members who are not owners from inviting someone as an owner, but the creator-role check compared the raw role string while later checks split and trimmed it. A role value with extra whitespace, such as " owner", passed the first check and became owner when the invitation was accepted. An organization admin, or any other non-creator role that can invite, can therefore create an owner account they control, which can then delete the organization and remove the original owners. The fix trims and splits role lists on commas wherever they are stored or compared, and rejects invitations with an empty role.
Upgrade the better-auth library to the patch version. Audit existing invitations and memberships for role values that change when trimmed, but do not trim them in place: trimming admin, owner makes that member a real owner.
You are affected if you are using a version that falls within the vulnerable range, use the organization plugin, and a role other than the creator role (owner by default) can create invitations. With the default roles, organization admins can.
1.5.5 - 1.7.15
Fixed in 1.7.16better-auth is vulnerable to Privilege Escalation in versions 1.5.5 - 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.