#97387Configurable Password Policies
Description
In order to provide strong defaults in regards to password security, TYPO3 will be able to validate user passwords against configurable password policies. This feature will increase the general security for TYPO3 users by providing a default password policy. Also TYPO3 as a CMS would be inline with recommendations on password security from the german BSI.
- TYPO3 will ships with a default password policy
- TYPO3 uses the default password policy for all scopes (backend and frontend user passwords)
- The default password policy can be extended
- It is possible to define custom password policies
- TYPO3 will by default only support 2 scopes (BE and FE user passwords), but can be extended to support user defined scopes (e.g. in order to validate custom password fields for tables other than be_users and fe_users)
Technical implementation
A password policy is defined by a set of validators (not Extbase validators). If a password policy consists of multiple validators, they are chained. A Password checked within a password policy must match all configured and active validators.
The PasswordPolicyValidator class will provides a function to validate a given password based on the current password policy for the current scope. The validation result (true/@false@) will be returned and potential validation error messages can be retrieved from the PasswordPolicyValidator instance.
Validators
Validators for usage in a password policy must implement the PasswordValidatorInterface or extend the AbstractPasswordValidator class. Besides validation logic, a validator must also be able to return an array of strings with password requirements (e.g. “minimun length x chars”) in order to provide human readable password requirements. In case of a failed validation a validation error message can be definied.
Validators can be excluded for certain actions (e.g. no current password check for password of new users). Available actions are definied globally in the class PasswordPolicyAction.
Password Policy Configuration
Password Policy configuration is located in LocalConfiguration.php as shown below:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['passwordPolicies'] = [
'default' => [
'validators' => [
\TYPO3\CMS\Core\PasswordPolicy\Validator\CorePasswordValidator::class => [
'options' => [
'minimumLength' => 8,
'upperCaseCharacterRequired' => true,
'lowerCaseCharacterRequired' => true,
'digitCharacterRequired' => true,
'specialCharacterRequired' => true,
],
'excludeActions' => [],
],
\TYPO3\CMS\Core\PasswordPolicy\Validator\NotCurrentPasswordValidator::class => [
'options' => [],
'excludeActions' => [
\TYPO3\CMS\Core\PasswordPolicy\PasswordPolicyAction::NEW_USER_PASSWORD,
],
],
],
],
];
$GLOBALS['TYPO3_CONF_VARS']['BE']['passwordPolicy'] = 'default';
$GLOBALS['TYPO3_CONF_VARS']['FE']['passwordPolicy'] = 'default';
Password Policies can globally be disabled (e.g. for development environment) by setting the BE/FE password policy to an empty value in AdditionalConfiguration.php
JavaScript module and API (TYPO3 backend only)
In order to provide instant feedback for users entering a password, a general JavaScript module needs to be developed, which validates a password when it is entered into a password field. The JavaScript module can be used for either password fields in FormEngine or regular password input fields (e.g. setup module or install tool) if possible.
Example:
typo3-password-field.png
A new backend route (similar to the slug suggest route) will use the configured password policy based on the given scope. Since custom password validators may use backend logic (e.g. check password against a deny-list), a client/server integration as described is required and has to be discussed.
Where can password policies be used in TYPO3?
- Backend and frontend user password change using DataHandler (TCA type=password)
- Backend user password (setup module)
- Password reset for backend user
- Password reset for frontend user
- Install tool – Create Administrative User
- Install tool – Install tool password
- Install tool – Initial admin user
Reviews 1
Linked, but not in Forger: Change 75472
Subtasks 12
- Feature #97388Introduce Password Policy feature and implement usage in ext:setup
- Feature #97389Add Password Policy check to FormEngine (TCA type=password) and DataHandler
- Feature #97390Add Password Policy check to ext:felogin
- Feature #97391Add Password Policy check to ext:backend
- Feature #97392Add Password Policy check to ext:install
- Task #97393Validate password policy on the fly in FormEngine
- Task #99574Make password policy ContextData DTO more flexible
- Feature #99608Add password policy action to exclude validators in SU mode
- Feature #100260Add ExcludeFromLiveCheckInterface
- Feature #100294Add PSR-14 events to modify ContextData DTO
- Task #100295Prevent setting empty password in backend password recovery
- Task #100300Respect security.usePasswordPolicyForFrontendUsers in TCA type=password
Related issues 5
History 1920
-
Torben Hansen changed Related to #80793 <span data-processor="relativetime" data-value="2022-04-15T06:00:23+00:00" > 04/15/22, 06:00 </span>
-
Torben Hansen changed description <span data-processor="relativetime" data-value="2022-04-15T10:42:28+00:00" > 04/15/22, 10:42 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 75472 status
NewUnder Review <span data-processor="relativetime" data-value="2022-08-15T21:37:56+00:00" > 08/15/22, 21:37 </span> -
Oliver Hader changed description <span data-processor="relativetime" data-value="2022-10-05T17:21:06+00:00" > 10/05/22, 17:21 </span>
-
Oliver Hader changed Related to #87299 <span data-processor="relativetime" data-value="2022-10-05T17:27:59+00:00" > 10/05/22, 17:27 </span>
-
Oliver Hader changed Related to #80792 <span data-processor="relativetime" data-value="2022-10-05T17:29:09+00:00" > 10/05/22, 17:29 </span>
-
Oliver Hader changed Related to #69190 <span data-processor="relativetime" data-value="2022-10-05T17:29:23+00:00" > 10/05/22, 17:29 </span>
-
Oliver Hader changed
Related to #80793<span data-processor="relativetime" data-value="2022-10-05T17:30:59+00:00" > 10/05/22, 17:30 </span> -
Oliver Hader changed Related to #80793 <span data-processor="relativetime" data-value="2022-10-05T17:31:33+00:00" > 10/05/22, 17:31 </span>
-
Oliver Hader changed description <span data-processor="relativetime" data-value="2022-10-05T17:33:58+00:00" > 10/05/22, 17:33 </span>
-
Jochen Roth changed Related to #99349 <span data-processor="relativetime" data-value="2022-12-12T22:06:42+00:00" > 12/12/22, 22:06 </span>
-
Torben Hansen changed subtask #99574 <span data-processor="relativetime" data-value="2023-01-17T12:42:41+00:00" > 01/17/23, 12:42 </span>
-
Torben Hansen changed subtask #99608 <span data-processor="relativetime" data-value="2023-01-18T13:17:13+00:00" > 01/18/23, 13:17 </span>
-
Torben Hansen changed subtask #100260 <span data-processor="relativetime" data-value="2023-03-22T18:30:32+00:00" > 03/22/23, 18:30 </span>
-
Torben Hansen changed subtask #100294 <span data-processor="relativetime" data-value="2023-03-24T17:22:44+00:00" > 03/24/23, 17:22 </span>
-
Torben Hansen changed subtask #100295 <span data-processor="relativetime" data-value="2023-03-24T17:31:36+00:00" > 03/24/23, 17:31 </span>
-
Torben Hansen changed subtask #100300 <span data-processor="relativetime" data-value="2023-03-25T10:56:49+00:00" > 03/25/23, 10:56 </span>
-
Benni Mack changed target version <span data-processor="relativetime" data-value="2023-06-05T09:23:12+00:00" > 06/05/23, 09:23 </span>
-
Simon Schaufelberger commented <span data-processor="relativetime" data-value="2026-06-16T10:59:26+00:00" > 06/16/26, 10:59 </span>
-
Torben Hansen commented <span data-processor="relativetime" data-value="2026-06-21T09:14:42+00:00" > 06/21/26, 09:14 </span>
@simonschaufi Only the open tickets (primary regarding the live-check/on-the-fly validation), but I think they are not really important currently. Epic can therefore be closed.
@derhansen Is there something still missing for this epic? V14 improved the password policies quite significantly