[GH-ISSUE #5183] Invitation Flow : A different user is able to signup based on the invitationId which was issued to a different user. #27504

Closed
opened 2026-04-17 18:33:31 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @madhuanildugar-ctrl on GitHub (Oct 9, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/5183

Originally assigned to: @Paola3stefania on GitHub.

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Send an invitation to xyz@gmail.com. Better-Auth gives you an invitationId.
Take that invitationId and if the user tries to register with different email like abc@gmail.com, abc@gmail.com user is getting registered, which shouldnt be allowed as he is using the invitationId of xyz@gmail.com

Current vs. Expected behavior

Send an invitation to xyz@gmail.com. Better-Auth gives you an invitationId.
Take that invitationId and if the user tries to register with different email like abc@gmail.com, abc@gmail.com user is getting registered, which shouldnt be allowed as he is using the invitationId of xyz@gmail.com

What version of Better Auth are you using?

1.3.26

System info

N/A

Which area(s) are affected? (Select all that apply)

Client

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @madhuanildugar-ctrl on GitHub (Oct 9, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/5183 Originally assigned to: @Paola3stefania on GitHub. ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce Send an invitation to xyz@gmail.com. Better-Auth gives you an invitationId. Take that invitationId and if the user tries to register with different email like abc@gmail.com, abc@gmail.com user is getting registered, which shouldnt be allowed as he is using the invitationId of xyz@gmail.com ### Current vs. Expected behavior Send an invitation to xyz@gmail.com. Better-Auth gives you an invitationId. Take that invitationId and if the user tries to register with different email like abc@gmail.com, abc@gmail.com user is getting registered, which shouldnt be allowed as he is using the invitationId of xyz@gmail.com ### What version of Better Auth are you using? 1.3.26 ### System info ```bash N/A ``` ### Which area(s) are affected? (Select all that apply) Client ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-17 18:33:31 -05:00
Author
Owner

@Bekacru commented on GitHub (Oct 9, 2025):

The invitation ID has nothing to do with who gets registered to your application, it only determines who can accept the invite.

An organization invitation isn’t the same as inviting a user to your app. We currently don’t have a user invitation implementation unless you’re using the org plugin

<!-- gh-comment-id:3386418666 --> @Bekacru commented on GitHub (Oct 9, 2025): The invitation ID has nothing to do with who gets registered to your application, it only determines who can accept the invite. An organization invitation isn’t the same as inviting a user to your app. We currently don’t have a user invitation implementation unless you’re using the org plugin
Author
Owner

@RVP97 commented on GitHub (Oct 9, 2025):

Are there any plans to support user invitation without org plugin? @Bekacru

<!-- gh-comment-id:3387643593 --> @RVP97 commented on GitHub (Oct 9, 2025): Are there any plans to support user invitation without org plugin? @Bekacru
Author
Owner

@jferrettiboke commented on GitHub (Oct 10, 2025):

I can't reproduce this. When a user is invited (for example, invitee@domain.com), only that specific email can be used by the recipient. Otherwise, the client will throw an error of type YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION.

fb2c6af6dc/packages/better-auth/src/plugins/organization/routes/crud-invites.ts (L508-L513)

<!-- gh-comment-id:3389769045 --> @jferrettiboke commented on GitHub (Oct 10, 2025): I can't reproduce this. When a user is invited (for example, invitee@domain.com), only that specific email can be used by the recipient. Otherwise, the client will throw an error of type `YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION`. https://github.com/better-auth/better-auth/blob/fb2c6af6dc69c4426be13952cf700aef35556955/packages/better-auth/src/plugins/organization/routes/crud-invites.ts#L508-L513
Author
Owner

@dosubot[bot] commented on GitHub (Jan 9, 2026):

Hi, @madhuanildugar-ctrl. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a potential security concern in Better-Auth v1.3.26 regarding registration using an invitationId tied to a different email.
  • It was clarified that invitation IDs control who can accept an invite, and user invitations without the org plugin are not supported.
  • Another user asked about plans for supporting user invitations without the org plugin.
  • A maintainer tested and could not reproduce the issue, confirming the system enforces email matching and throws an error if the invitee email does not match.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of better-auth by commenting below.
  • If no further activity occurs, I will automatically close this issue in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:3729601289 --> @dosubot[bot] commented on GitHub (Jan 9, 2026): Hi, @madhuanildugar-ctrl. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a potential security concern in Better-Auth v1.3.26 regarding registration using an invitationId tied to a different email. - It was clarified that invitation IDs control who can accept an invite, and user invitations without the org plugin are not supported. - Another user asked about plans for supporting user invitations without the org plugin. - A maintainer tested and could not reproduce the issue, confirming the system enforces email matching and throws an error if the invitee email does not match. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of better-auth by commenting below. - If no further activity occurs, I will automatically close this issue in 7 days. Thank you for your understanding and contribution!
Author
Owner

@Paola3stefania commented on GitHub (Jan 11, 2026):

Are there any plans to support user invitation without org plugin? @Bekacru

Hi @RVP97 , its not something we will support for now . Let me know if I can help with something else :)

<!-- gh-comment-id:3733753090 --> @Paola3stefania commented on GitHub (Jan 11, 2026): > Are there any plans to support user invitation without org plugin? [@Bekacru](https://github.com/Bekacru) Hi @RVP97 , its not something we will support for now . Let me know if I can help with something else :)
Author
Owner

@dosubot[bot] commented on GitHub (Jan 11, 2026):

Thank you for your response and the clarification. We'll go ahead and close this issue now. Please feel free to reach out if you need any further assistance!

<!-- gh-comment-id:3733754944 --> @dosubot[bot] commented on GitHub (Jan 11, 2026): Thank you for your response and the clarification. We'll go ahead and close this issue now. Please feel free to reach out if you need any further assistance!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#27504