Security: The "administer users" permission exposes user/1

Created on 2 December 2005, over 19 years ago
Updated 14 July 2025, 2 days ago

This very simple patch makes it so that users other than uid 1 cannot edit edit uid 1. You may want to have several administrators able to futz with user accounts, but the admin should be protected from a cranky user.

(This was suggested by a comment in another thread, but I felt it should be a separate patch.)

✨ Feature request
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

user system

Created by

πŸ‡ΊπŸ‡ΈUnited States Crell

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for sharing your idea for improving Drupal.

    We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • This issue seems obsolete due to this change record: Super user access policy can be turned off β†’ . See also Securing the admin super user (#1) β†’ .

    Site admins can also install the Paranoia β†’ module.

    The proper way to secure a Drupal site is to create a lesser admin role with safer permissions and use that for people who are admins, then remove all access checks of UID 1 and the 'administrator' role in the code. Processes that need to run with admin permissions can use a dummy user session:

    $this->accountSwitcher->switchTo(new UserSession(['roles' => ['administrator']]));
    

    Or you can even narrow down access by permission.

Production build 0.71.5 2024