Gepostet am:26.11.2008 01:00
#1
Bugfix für Sicherheitslücke Identitätswechsel - XOOPS 2.3.1
26.11.2008 01:00 Anleitung:
ausgehend vom XOOPS_ROOT_PATH (da wo die mainfile.php liegt)
Datei /include/checklogin.php:
Suche nach (ca Zeile 81):
// Set cookie for rememberme
if ( !empty($xoopsConfig['usercookie']) ) {
if ( !empty($_POST["rememberme"]) ) {
setcookie($xoopsConfig['usercookie'], $_SESSION['xoopsUserId'], time() + 31536000, '/', '', 0);
} else {
setcookie($xoopsConfig['usercookie'], 0, -1, '/', '', 0);
}
}
ersetzen mit
// Set cookie for rememberme
if ( !empty($xoopsConfig['usercookie']) ) {
if ( !empty($_POST["rememberme"]) ) {
setcookie($xoopsConfig['usercookie'], $_SESSION['xoopsUserId']."-".md5($user->getVar('pass').XOOPS_DB_PASS.XOOPS_DB_PREFIX), time() + 31536000, '/', '', 0);
} else {
setcookie($xoopsConfig['usercookie'], 0, -1, '/', '', 0);
}
}
weiter Datei /include/common.php (Zeile 262), suche nach:
// Load xoopsUserId from cookie if "Remember me" is enabled.
if (empty($_SESSION['xoopsUserId']) && !empty($xoopsConfig['usercookie']) && !empty($_COOKIE[$xoopsConfig['usercookie']])) {
$_SESSION['xoopsUserId'] = $_COOKIE[$xoopsConfig['usercookie']];
}
ersetzen mit
// Load xoopsUserId from cookie if "Remember me" is enabled.
if (empty($_SESSION['xoopsUserId']) && !empty($xoopsConfig['usercookie']) && !empty($_COOKIE[$xoopsConfig['usercookie']])) {
$sess_data = explode("-",$_COOKIE[$xoopsConfig['usercookie']]);
if (count($sess_data)==2) $_SESSION['xoopsUserId'] = $sess_data[0];
}
weiter gleiche Datei (Zeile 273): aus
} else {
$GLOBALS["sess_handler"]->update_cookie();
if (isset($_SESSION['xoopsUserGroups'])) {
$xoopsUser->setGroups($_SESSION['xoopsUserGroups']);
} else {
$_SESSION['xoopsUserGroups'] = $xoopsUser->getGroups();
}
$xoopsUserIsAdmin = $xoopsUser->isAdmin();
}
ein :
} else {
if (!empty($sess_data) && (md5($xoopsUser->getVar('pass').XOOPS_DB_PASS.XOOPS_DB_PREFIX) != $sess_data[1])) {
$xoopsUser = '';
$_SESSION = array();
session_destroy();
} else {
$GLOBALS["sess_handler"]->update_cookie();
if (isset($_SESSION['xoopsUserGroups'])) {
$xoopsUser->setGroups($_SESSION['xoopsUserGroups']);
} else {
$_SESSION['xoopsUserGroups'] = $xoopsUser->getGroups();
}
$xoopsUserIsAdmin = $xoopsUser->isAdmin();
}
}
Damit ist dann das XOOPS wieder sicher.
Wir informieren weiter dazu.
Wer Hilfe dazu benötigt, bitte melden.