Issue Bug Rejected

#105990Backend editors automatically copy passwords

Lina Wolf 01/26/25, 09:38 updated 04/03/25, 06:28

Description

When a backend editor copies a backend user record, the users password is automatically copied as well.

This could lead to large numbers of frontend users having the same initial password.

I would suggest that the password is cleared or a random one assigned and that password fields in general are not copyable (just like unique fields will be altered on copy paste).

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 3

  1. Torben Hansen commented <span data-processor="relativetime" data-value="2025-01-27T07:36:06+00:00" > 01/27/25, 07:36 </span>

    I do not agree on clearing or changing the password to a random value on copy, because this is unexpected behavior for a copy-process and there may be valid use cases, where also password hashes are expected to be copied from one site to another.

  2. André Buchmann commented <span data-processor="relativetime" data-value="2025-01-29T09:45:18+00:00" > 01/29/25, 09:45 </span>

    I agree with Torben on this. A copy is a copy.

    However on project level this may could be handled with some datahandler hook, which generates a new password.

    I’ve just done something similar by setting the passwordfield to “passthrough” and generating a random password for new users:

    public function processDatamap_postProcessFieldArray(string $status, string $table, $id, array &$fieldArray, DataHandler $dataHandler): void
        {
            if ($table !== 'fe_users') {
                return;
            }
    
            if ($status === 'new') {
                $random = GeneralUtility::makeInstance(Random::class);
                try {
                    $fieldArray['password'] = $random->generateRandomPassword(['length' => 32, 'specialCharacters' => true]);
                } catch (InvalidPasswordRulesException $e) {
                }
            }
        }

    Background: I don’t want the editor to send the feuser password to the user. They should use the pw-recorvery to set a new password. I might add a “send welcome mail” button to the backend to trigger a notification to the user to set a new password himself.

  3. Georg Ringer commented and changed status New Rejected <span data-processor="relativetime" data-value="2025-04-03T06:28:23+00:00" > 04/03/25, 06:28 </span>

    hey lina,

    I am closing this issue as a copy should be a copy. Feel free to create an extension which hooks into the datahandler to modify the password + provide a flash message.

    my usecase in local dev installations: I have the same password for all users because easier to test and if I copy an test editor user I really expect that the password is the same