The vulnerability, identified as GHSA-fmh4-wcc4-5jm3, allowed an attacker to accept organization invitations on behalf of a victim. This was possible because the better-auth organization plugin did not properly verify email ownership. An attacker could create an account using a victim's email address and, if they obtained an invitation link meant for the victim, could accept it and join the organization.
The root cause was that the invitation-related endpoints (acceptInvitation, rejectInvitation, getInvitation, listUserInvitations) only checked if the session user's email string matched the email in the invitation. They did not check if the emailVerified flag for the user was true.
The patch addresses this by making two key changes in packages/better-auth/src/plugins/organization/routes/crud-invites.ts:
- It changes the default for the
requireEmailVerificationOnInvitation option from false to true. This means that, by default, email verification is now required.
- It adds the email verification check to the
getInvitation and listUserInvitations functions, which previously had no such protection. The check was already present but optional in acceptInvitation and rejectInvitation.
By enforcing email verification across all four endpoints by default, the patch ensures that only a user who has proven control of an email address can act on invitations sent to that address.