fix(security): require administrator role for user and account management#322
Open
Isaries wants to merge 1 commit into
Open
fix(security): require administrator role for user and account management#322Isaries wants to merge 1 commit into
Isaries wants to merge 1 commit into
Conversation
…ment The admin surface was gated by a single URL rule allowing both administrators and researchers, so a researcher could reach the user, role, portal and news management endpoints and grant themselves the administrator role, disable accounts, or read other users' details. Restrict those endpoints to administrators at the URL layer and add method-level enforcement on the account management controllers so the restriction does not depend on the URL configuration alone.
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.
Summary
Several user and account management endpoints under
/adminwere reachable by the researcher role through the broad/admin/**rule. A researcher could therefore grant themselves the administrator role or manage other users' accounts. This restricts those endpoints to administrators only.Changes
@Secured("ROLE_ADMINISTRATOR")to the user, role, account, portal and news admin controllers./admin/account/**,/admin/portal/**,/admin/news/**,/admin/mergeProjectMetadata,/admin/run/replacebase64withpng.html,/api/admin/**) require the administrator role. These more specific rules are listed before the broader/admin/**rule so they take precedence. Researchers keep access to the remaining/admin/**endpoints.Testing
mvnw package).securedEnabled = true, so the annotations are active.