KC-1435: Prevent delegated admin privilege escalation by validating user permissions - #2347
Open
sshrushanth-ks wants to merge 2 commits into
Open
Conversation
sshrushanth-ks
marked this pull request as ready for review
September 4, 2026 09:55
sshrushanth-ks
requested review from
amangalampalli-ks,
pvagare-ks and
sali-ks
September 4, 2026 10:12
sshrushanth-ks
force-pushed
the
transfer-account-privilege-fix-int
branch
2 times, most recently
from
September 4, 2026 11:49
94f0205 to
516f931
Compare
sshrushanth-ks
force-pushed
the
transfer-account-privilege-fix
branch
from
September 4, 2026 11:52
fb21817 to
1e8dfbb
Compare
…ions before granting transfer_account, manage_teams, manage_companies, etc.
…force removal restriction, case-insensitive usernames, extract helpers and constants
sshrushanth-ks
force-pushed
the
transfer-account-privilege-fix-int
branch
from
September 4, 2026 11:53
516f931 to
49218c2
Compare
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
Delegated admins without
transfer_account,manage_teams, ormanage_companiesprivileges could escalate by granting these privileges to roles they manage, bypassing authorization checks. Therequire_account_shareenforcement setting could also be set by non-root delegated admins, restricting account access for managed users. Privilege grants now verify the current user holds each privilege before allowing the grant, andrequire_account_shareenforcement is restricted to root admins only.Changes
enterprise.py:require_account_shareenforcement to root admins; check if current user's roles manage any root nodes (nodes with no parent_id)data_enterprise.py: Add test roles and role_privileges data with test privilege assignments for verificationtest_command_enterprise.py: Add 6 security tests covering privilege possession checks, root admin restriction, and regression tests for allowed operations