You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I found a security issue. All users can create invite codes.
To Reproduce
Steps to reproduce the behavior:
Login or Signup
Activate Require invite code for new sign ups
Generate a code
Create a new account with the code generated in the previous step
With this new account got to Settings > Self Hosted
Expected behavior
I think only "admin" users could generate codes.
What version of Maybe are you using?
Self Hosted, v0.2.0
What operating system and browser are you using?
The problem is on all OS and browsers
An idea to fix this problem would be to set an "admin email" in env vars. Only the user logged in with this email could do some actions like generate invite code.
If this solution sounds good to you, I can implement it.
The text was updated successfully, but these errors were encountered:
@hecht-a yep, think that would be a good improvement. This should be relatively simple—we've already got a role field on the users table, so just a matter of checking Current.user.admin? prior to the code generation in InviteCodesController
zachgoll
changed the title
Bug: Security issue in invite code generation
Bug: Self hosted invite codes should only be generated by admins
Jan 8, 2025
Hello 👋
Describe the bug
I found a security issue. All users can create invite codes.
To Reproduce
Steps to reproduce the behavior:
Require invite code for new sign ups
Settings > Self Hosted
Expected behavior
I think only "admin" users could generate codes.
What version of Maybe are you using?
Self Hosted, v0.2.0
What operating system and browser are you using?
The problem is on all OS and browsers
An idea to fix this problem would be to set an "admin email" in env vars. Only the user logged in with this email could do some actions like generate invite code.
If this solution sounds good to you, I can implement it.
The text was updated successfully, but these errors were encountered: