Skip to content

Restrict configuration permission assignment to superusers in the user API#15296

Open
svader0 wants to merge 1 commit into
DefectDojo:bugfixfrom
svader0:harden-user-configuration-permission-assignment
Open

Restrict configuration permission assignment to superusers in the user API#15296
svader0 wants to merge 1 commit into
DefectDojo:bugfixfrom
svader0:harden-user-configuration-permission-assignment

Conversation

@svader0

@svader0 svader0 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Consistency and hardening change to the user API serializer. Assigning or changing a user's configuration permissions is now limited to superusers, matching how the same serializer already treats the other privilege-bearing user fields (staff and superuser status). Includes a regression test. No functional change for superusers, who manage these permissions today.

🤖 Generated with Claude Code

…r API

Assigning or changing a user's configuration permissions through the user
API is now limited to superusers, matching how the serializer already
treats the other privilege-bearing fields (staff and superuser status).
Adds a regression test. No functional change for superusers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@svader0
svader0 force-pushed the harden-user-configuration-permission-assignment branch from 5264ac6 to 0a0fd02 Compare July 20, 2026 23:33
valentijnscholten added a commit that referenced this pull request Jul 21, 2026
v3 security-parity review of three open v2 hardening PRs (#15300,
#15296, #15191): #15300 IMMUNE (v3 locations read-only, no reference-
write surface); #15296 IMMUNE (configuration_permissions not on the v3
user write surface); #15191 identity half was a REAL GAP now fixed.

Gap: get_authorized_users returns co-members, so a non-superuser with
view_user+change_user could PATCH/PUT a visible co-member's email or
username -> account takeover via password reset. Adds
_enforce_identity_field_rules (mirrors UserSerializer.validate()):
superuser unrestricted, self-edit allowed, email/username change to
another account -> 400; create is a no-op. Wired into PATCH and PUT
after the superuser/staff gate; deny-by-default sweep unchanged.

+6 tests. (API_V3_PLAN.md also carries the examples-refresh §12 row
committed next.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants