Index: t3lib/config_default.php =================================================================== --- t3lib/config_default.php (revision 5368) +++ t3lib/config_default.php (working copy) @@ -192,7 +192,7 @@ 'lockSSL' => 0, // Int. 0,1,2,3: If set (1,2,3), the backend can only be operated from an ssl-encrypted connection (https). Set to 2 you will be redirected to the https admin-url supposed to be the http-url, but with https scheme instead. If set to 3, only the login is forced to SSL, then the user switches back to non-SSL-mode 'lockSSLPort' => 0, // Integer. Use a non-standard HTTPS port for lockSSL. Set this value if you use lockSSL and the HTTPS port of your webserver is not 443. 'enabledBeUserIPLock' => 1, // Boolean. If set, the User/Group TSconfig option 'option.lockToIP' is enabled. - 'loginSecurityLevel' => '', // String. Keywords that determines the security level of login to the backend. "normal" means the password from the login form is sent in clear-text, "challenged" means the password is not sent but hashed with some other values, "superchallenged" (default) means the password is first hashed before being hashed with the challenge values again (means the password is stored as a hashed string in the database also). DO NOT CHANGE this value manually; without an alternative authentication service it will only prevent logins in TYPO3 since the "superchallenged" method is hardcoded in the default authentication system. + 'loginSecurityLevel' => '', // String. Keywords that determines the security level of login to the backend. "normal" means the password from the login form is sent in clear-text, "challenged" means the password is not sent but hashed with some other values, "superchallenged" (default) means the password is first hashed before being hashed with the challenge values again (means the password is stored as a hashed string in the database also), "rsa" uses RSA password encryption (only if the rsaauth extension is installed). DO NOT CHANGE this value manually; without an alternative authentication service it will only prevent logins in TYPO3 since the "superchallenged" method is hardcoded in the default authentication system. 'adminOnly' => 0, // Int. If set (>=1), the only "admin" users can log in to the backend. If "<=-1" then the backend is totally shut down! For maintenance purposes. 'disable_exec_function' => 0, // Boolean. Don't use exec() function (except for ImageMagick which is disabled by [GFX][im]=0). If set, all fileoperations are done by the default PHP-functions. This is nescessary under Windows! On Unix the system commands by exec() can be used, unless this is disabled. 'usePHPFileFunctions' => 1, // Boolean. If set, all fileoperations are done by the default PHP-functions. Default on Unix is using the system commands by exec(). You need to set this flag under safe_mode. @@ -287,7 +287,7 @@ 'addRootLineFields' => '', // Comma-list of fields from the 'pages'-table. These fields are added to the select query for fields in the rootline. 'checkFeUserPid' => 1, // Boolean. If set, the pid of fe_user logins must be sent in the form as the field 'pid' and then the user must be located in the pid. If you unset this, you should change the fe_users.username eval-flag 'uniqueInPid' to 'unique' in $TCA. This will do: $TCA['fe_users']['columns']['username']['config']['eval']= 'nospace,lower,required,unique'; 'lockIP' => 2, // Integer (0-4). If >0, fe_users are locked to (a part of) their REMOTE_ADDR IP for their session. Enhances security but may throw off users that may change IP during their session (in which case you can lower it to 2 or 3). The integer indicates how many parts of the IP address to include in the check. Reducing to 1-3 means that only first, second or third part of the IP address is used. 4 is the FULL IP address and recommended. 0 (zero) disables checking of course. - 'loginSecurityLevel' => '', // See description for TYPO3_CONF_VARS[BE][loginSecurityLevel]. Default state for frontend is "normal". Alternative authentication services can implement higher levels if preferred. + 'loginSecurityLevel' => '', // See description for TYPO3_CONF_VARS[BE][loginSecurityLevel]. Default state for frontend is "normal". Alternative authentication services can implement higher levels if preferred. For example, "rsa" level uses RSA password encryption (only if the rsaauth extension is installed) 'lifetime' => 0, // Integer, positive. If >0, the cookie of FE users will have a lifetime of the number of seconds this value indicates. Otherwise it will be a session cookie (deleted when browser is shut down). Setting this value to 604800 will result in automatic login of FE users during a whole week, 86400 will keep the FE users logged in for a day. 'permalogin' => 2, // Integer. -1: Permanent login for FE users disabled. 0: By default permalogin is disabled for FE users but can be enabled by a form control in the login form. 1: Permanent login is by default enabled but can be disabled by a form control in the login form. // 2: Permanent login is forced to be enabled. // In any case, permanent login is only possible if TYPO3_CONF_VARS[FE][lifetime] lifetime is > 0. 'maxSessionDataSize' => 10000, // Integer. Setting the maximum size (bytes) of frontend session data stored in the table fe_session_data. Set to zero (0) means no limit, but this is not recommended since it also disables a check that session data is stored only if a confirmed cookie is set. Index: t3lib/class.t3lib_beuserauth.php =================================================================== --- t3lib/class.t3lib_beuserauth.php (revision 5368) +++ t3lib/class.t3lib_beuserauth.php (working copy) @@ -96,7 +96,6 @@ var $formfield_uident = 'userident'; // formfield with password var $formfield_chalvalue = 'challenge'; // formfield with a unique value which is used to encrypt the password and username var $formfield_status = 'login_status'; // formfield with status: *'login', 'logout' - var $security_level = 'superchallenged'; // sets the level of security. *'normal' = clear-text. 'challenged' = hashed password/username from form in $formfield_uident. 'superchallenged' = hashed password hashed again with username. var $writeStdLog = 1; // Decides if the writelog() function is called at login and logout var $writeAttemptLog = 1; // If the writelog() functions is called if a login-attempt has be tried without success @@ -140,6 +139,18 @@ /** + * Sets the security level for the Backend login + * + * @return void + */ + function start() { + $securityLevel = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel']); + $this->security_level = $securityLevel ? $securityLevel : 'superchallenged'; + + parent::start(); + } + + /** * If flag is set and the extensions 'beuser_tracking' is loaded, this will insert a table row with the REQUEST_URI of current script - thus tracking the scripts the backend users uses... * This function works ONLY with the "beuser_tracking" extension and is deprecated since it does nothing useful. * Index: t3lib/class.t3lib_userauth.php =================================================================== --- t3lib/class.t3lib_userauth.php (revision 5368) +++ t3lib/class.t3lib_userauth.php (working copy) @@ -199,7 +199,13 @@ $this->loginType = ($this->name=='fe_typo_user') ? 'FE' : 'BE'; // set level to normal if not already set - $this->security_level = $this->security_level ? $this->security_level : 'normal'; + if (!$this->security_level) { + // Notice: cannot use TYPO3_MODE here because BE user can be logged in and operate inside FE! + $this->security_level = trim($TYPO3_CONF_VARS[$this->loginType]['loginSecurityLevel']); + if (!$this->security_level) { + $this->security_level = 'normal'; + } + } // enable dev logging if set if ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['writeDevLog']) $this->writeDevLog = TRUE; @@ -332,6 +338,7 @@ if ((rand()%100) <= $this->gc_probability) { $this->gc(); } + } /** Index: typo3/index.php =================================================================== --- typo3/index.php (revision 5368) +++ typo3/index.php (working copy) @@ -119,6 +119,9 @@ * @return void */ function init() { + // We need a PHP session session for most login levels + session_start(); + $this->redirect_url = t3lib_div::_GP('redirect_url'); $this->GPinterface = t3lib_div::_GP('interface'); @@ -171,11 +174,9 @@ $TBE_TEMPLATE->bodyTagAdditions = ' onload="startUp();"'; $TBE_TEMPLATE->moduleTemplate = $TBE_TEMPLATE->getHtmlTemplate('templates/login.html'); - // Set JavaScript for creating a MD5 hash of the password: $TBE_TEMPLATE->JScode.= $this->getJScode(); - // Checking, if we should make a redirect. // Might set JavaScript in the header to close window. $this->checkRedirect(); @@ -204,15 +205,8 @@ // Add login form: $this->content.=$this->wrapLoginForm($loginForm); - // Create a random challenge string - $challenge = $this->getChallenge(); - - // Save challenge value in session data (thanks to Bernhard Kraft for providing code): - session_start(); - $_SESSION['login_challenge'] = $challenge; - // Add hidden fields and end the page - $this->content.= $this->getHiddenFields($challenge); + $this->content .= $this->getHiddenFields(); $this->content.= $TBE_TEMPLATE->endPage(); } @@ -226,13 +220,6 @@ echo $this->content; } - - - - - - - /***************************** * * Various functions @@ -355,7 +342,7 @@ if ($BE_USER->user['uid'] && ($this->commandLI || $this->loginRefresh || !$this->interfaceSelector)) { // If no cookie has been set previously we tell people that this is a problem. This assumes that a cookie-setting script (like this one) has been hit at least once prior to this instance. - if (!$_COOKIE[$BE_USER->name]) { + if (!$_COOKIE[$BE_USER->name]) { if ($this->commandLI=='setCookie') { // we tried it a second time but still no cookie // 26/4 2005: This does not work anymore, because the saving of challenge values in $_SESSION means the system will act as if the password was wrong. @@ -367,10 +354,10 @@ } } - if ($redirectToURL = (string)$BE_USER->getTSConfigVal('auth.BE.redirectToURL')) { + if (($redirectToURL = (string)$BE_USER->getTSConfigVal('auth.BE.redirectToURL'))) { $this->redirectToURL = $redirectToURL; $this->GPinterface = ''; - } + } // store interface $BE_USER->uc['interfaceSetup'] = $this->GPinterface; @@ -589,103 +576,86 @@ function startForm() { $output = ''; - if ($this->loginSecurityLevel == 'challenged') { - $output.= ' -