Compatibility with security.enable_super_user = false

Created on 15 July 2024, 9 months ago

Problem/Motivation

With this setting disabled, UID 1 is not special anymore: https://www.drupal.org/node/2910500
Now any user can be an administrator.

Steps to reproduce

Add this to services.yml:

parameters:
  security.enable_super_user: false

Browse to /admin/people/role-settings and select a role as the admin role.
Now any user with this role has every permission.

Proposed resolution

The module should disable editing any user with the admin role.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇫🇷France prudloff Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @prudloff
  • 🇳🇴Norway eiriksm Norway

    Hm, that seems counterintuitive with the name of the module :)

    Also, it's quite a different attack surface to edit a super user, compared to an admin role, which may or may not be super users per se.

    Personally I would rather make this module do nothing if that setting is enabled. Thoughts?

  • 🇫🇷France prudloff Lille

    IMHO an user with admin role is basically the same thing as a super user (except the UID is not hardcoded).
    A role that has is_admin: true in its config automatically has every permission.

    Also, it's quite a different attack surface to edit a super user, compared to an admin role, which may or may not be super users per se.

    I am not sure the attack surface is different.
    Getting control of user 1 gives every permission.
    Getting control of a user with an admin role (a role that has the is_admin flag) gives every permission.

  • 🇳🇴Norway eiriksm Norway

    Hm, you may be right about this. I guess I was not up to date on the role flag, I thought it was possible to override the permissions even if the role was admin.

    Happy to review some code suggestions if you have them :)

  • Pipeline finished with Success
    2 months ago
    Total: 164s
    #407466
  • Status changed to Needs review 14 days ago
Production build 0.71.5 2024