-
-
Notifications
You must be signed in to change notification settings - Fork 803
Re-enabling the superadmin group #1767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -272,12 +272,8 @@ function loadESXPlayer(identifier, playerId, isNew) | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| -- Group | ||||||||||||||||||||||||
| if result.group then | ||||||||||||||||||||||||
| if result.group == "superadmin" then | ||||||||||||||||||||||||
| userData.group = "admin" | ||||||||||||||||||||||||
| print("[^3WARNING^7] ^5Superadmin^7 detected, setting group to ^5admin^7") | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| userData.group = result.group | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| userData.group = result.group | |
| userData.group = result.group |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By removing the logic that downgraded result.group == "superadmin" to "admin", any users.group value of "superadmin" is now loaded directly into userData.group and passed to CreateExtendedPlayer, which ultimately leads to add_principal identifier.<license> group.superadmin. If an attacker can influence the users.group column (e.g., via a vulnerable admin panel, misconfigured tooling, or partial DB compromise), they can grant themselves full FiveM/ACE group.superadmin rights instead of being limited to group.admin as before. To maintain a safety boundary between regular ESX admins and server superadmins, keep superadmin values rejected or downgraded here and manage group.superadmin membership only via trusted out-of-band ACL configuration.
| userData.group = result.group | |
| -- Prevent database-controlled escalation to superadmin. | |
| -- Superadmin ACE rights should be managed only via trusted ACL configuration. | |
| if result.group == "superadmin" then | |
| userData.group = "admin" | |
| else | |
| userData.group = result.group | |
| end |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -510,10 +510,6 @@ ESX.RegisterCommand( | |||||||||||
| if not args.playerId then | ||||||||||||
| args.playerId = xPlayer.source | ||||||||||||
| end | ||||||||||||
|
||||||||||||
| end | |
| end | |
| if args.group == "superadmin" then | |
| args.group = "admin" | |
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line contains only whitespace and should be removed. The conditional logic can be simplified by directly assigning result.group to userData.group without the empty line.