Repository navigation
Fix a few API authorization gaps - #7273
Merged
Merged
Conversation
Application keys scoped to users could create a root administrator or take over an existing one by changing their password, which made a users-only key equivalent to full panel access. Creating an admin, or updating or deleting one, now requires a key with write access to every resource. Sessions and account keys are unaffected since they already require a root administrator. Node configuration and deploy tokens return the Wings daemon token, so one leaked account key was enough to take over every node. The admin endpoints now require a panel session, and the application endpoint no longer accepts account keys. Deployment with application keys still works as before. The email change endpoint ran the unique rule before checking the password, so any logged in user could tell whether an address was registered from the 422 versus 400 response. The password is now verified first and the email is only validated once it matches.
|
3 is already covered by #7259 |
The same enumeration issue is already being fixed in pterodactyl#7259, so leave UpdateEmailRequest untouched here to avoid conflicting changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
userswrite could create a root admin or change an admin's password. Touching root admins now needs a key with write on everything.wings configurewith an application key still works.The email enumeration issue I originally had here is already covered by #7259, so I dropped it.
Added tests for each. Full test suite, phpstan and pint pass. Checked the node config page and auto-deploy in the admin UI still work.