Skip to content

KC-1435: Prevent delegated admin privilege escalation by validating user permissions - #2347

Open
sshrushanth-ks wants to merge 2 commits into
transfer-account-privilege-fixfrom
transfer-account-privilege-fix-int
Open

KC-1435: Prevent delegated admin privilege escalation by validating user permissions#2347
sshrushanth-ks wants to merge 2 commits into
transfer-account-privilege-fixfrom
transfer-account-privilege-fix-int

Conversation

@sshrushanth-ks

Copy link
Copy Markdown
Contributor

Summary

Delegated admins without transfer_account, manage_teams, or manage_companies privileges could escalate by granting these privileges to roles they manage, bypassing authorization checks. The require_account_share enforcement 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, and require_account_share enforcement is restricted to root admins only.

Changes

  • enterprise.py:
    • Add privilege possession check before granting sensitive privileges; identify current user from params and extract their role privileges for the managed node; reject grant if user lacks privilege
    • Restrict require_account_share enforcement 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 verification
  • test_command_enterprise.py: Add 6 security tests covering privilege possession checks, root admin restriction, and regression tests for allowed operations

@sshrushanth-ks sshrushanth-ks self-assigned this Sep 4, 2026
@sshrushanth-ks
sshrushanth-ks marked this pull request as ready for review September 4, 2026 09:55
@sshrushanth-ks
sshrushanth-ks force-pushed the transfer-account-privilege-fix-int branch 2 times, most recently from 94f0205 to 516f931 Compare September 4, 2026 11:49
@sshrushanth-ks
sshrushanth-ks force-pushed the transfer-account-privilege-fix branch from fb21817 to 1e8dfbb Compare September 4, 2026 11:52
…ions before granting transfer_account, manage_teams, manage_companies, etc.
…force removal restriction, case-insensitive usernames, extract helpers and constants
@sshrushanth-ks
sshrushanth-ks force-pushed the transfer-account-privilege-fix-int branch from 516f931 to 49218c2 Compare September 4, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant