Restrict configuration permission assignment to superusers in the user API#15296
Open
svader0 wants to merge 1 commit into
Open
Restrict configuration permission assignment to superusers in the user API#15296svader0 wants to merge 1 commit into
svader0 wants to merge 1 commit into
Conversation
…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
force-pushed
the
harden-user-configuration-permission-assignment
branch
from
July 20, 2026 23:33
5264ac6 to
0a0fd02
Compare
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.)
blakeaowens
approved these changes
Jul 21, 2026
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.
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