Optionally hide the password field for admins

Created on 20 February 2020, almost 5 years ago
Updated 18 August 2023, over 1 year ago

It's a bit of a security weakness that Drupal lets an admin set a password for users of a site.

  • An admin can change the password of a user and then log in as that user and take malicious actions while pretending to be that user (e.g. posting rude comments).
  • An admin is likely to be lazy and enter in a weak password as they create users.
  • An admin who sets the password is likely to share the password via an insecure method (email, chat message, writing it down).

It would be safest to configure this module during admin creation of users so:

  1. This module generates a strong password.
  2. This module does not display the password to the admin.
  3. The admin cannot enter a password for the user (i.e. the field is not present except on the admin's own account).

Items 1 and 2 of the proposed mitigation are already in place, however item #3 is not. This issue is about adding item #3.

There should be automated tests for:

1. The page to create a user shows the password field by default.
2. If this option is enabled, the user creation page does not show a password input field.
3. A user edit page does not show the password field when it's for editing another user.
4. The admin can edit their own password on their own user edit page.

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States greggles Denver, Colorado, USA

Live updates comments and jobs are added and updated live.
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.

Production build 0.71.5 2024