Intel

AIKIDO-2026-907407

better-auth is vulnerable to Privilege Escalation

GHSA-c85h-5mrr-mgx4Published Nov 4, 2026
November 4, 2026

49

CVE Score

Medium

Privilege Escalation

Are you affected? Scan for Free

TL;DR

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.

How do I fix this?

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.

Who does this affect?

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.

Versions

1.5.5 - 1.7.15

Fixed in 1.7.16

Background info

better-auth is vulnerable to Privilege Escalation in versions 1.5.5 - 1.7.15.

Get secure today,
quickly and for free.

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.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea