Files
open-webui/backend/open_webui/routers
4c06b392da Don't let SCIM's active flag demote an admin (defense-in-depth) (#25948)
The SCIM update_user (PUT) and patch_user (PATCH) handlers mapped the SCIM active field
unconditionally onto the role column (role = 'user' if active else 'pending'), so a routine
IdP sync or a misconfigured IdP that marked a locally-provisioned admin inactive would
silently strip that admin's role and could lock an instance out of its own administration.

Gate both active->role assignments on user.role != 'admin' so SCIM provisioning can
activate/deactivate ordinary users but never demotes an existing admin; admin role changes
continue to go through the dedicated admin endpoints. SCIM already cannot promote to admin
(active only maps to user/pending), so this is symmetric.

Credit to @HOHK0923 for surfacing the admin-demotion footgun.

Co-authored-by: HOHK0923 <118590749+HOHK0923@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 23:59:55 +02:00
..
2026-06-16 23:24:27 +02:00
2026-06-16 23:30:24 +02:00
2026-06-16 23:59:24 +02:00
2026-06-15 23:34:24 +02:00
2026-06-01 13:20:33 -07:00
2026-06-16 22:53:57 +02:00
2026-06-01 13:56:55 -07:00
2026-06-01 13:56:55 -07:00
2026-06-01 13:56:55 -07:00
2026-06-01 13:56:55 -07:00
2026-06-01 13:56:55 -07:00
2026-06-01 13:56:55 -07:00
2026-05-14 13:19:00 +09:00
2026-06-01 13:56:55 -07:00
2026-06-01 13:56:55 -07:00
2026-05-21 16:25:25 +04:00