Joomla 1.5 vừa được phát hiện một lỗi bảo mật nguy hiểm, mà dựa vào đó người tấn công có thể reset lại mật khẩu của người quản trị (người có quyền cao nhất trong hệ thống). Website sử dụng Joomla với tên người quản trị mặc định thì hiệu quả tấn công này là 100%, còn không thì người tấn công phải dò, đoán tên người quản trị. Không biết các trang web của nước mình update lại bản sửa lỗi của Joomla chưa đây...
Dưới đây là review lỗi vừa được tìm thấy
File : /components/com_user/controller.php
function confirmreset()
{
// Check for request forgeries
JRequest::checkToken() or die( 'Invalid Token' );
// Get the input
$token = JRequest::getVar('token', null, 'post', 'alnum'); [1]
// Get the model
$model = &$this->getModel('Reset');
// Verify the token
if ($model->confirmReset($token) === false)
{
$message = JText::sprintf('PASSWORD_RESET_CONFIRMATION_FAILED', $model->getError());
$this->setRedirect('index.php?option=com_user&view=reset&layout=confirm', $message);
return false;
}
$this->setRedirect('index.php?option=com_user&view=reset&layout=complete');
}
File : /components/com_user/models/reset.php
function confirmReset($token)
{
global $mainframe;
$db = &JFactory::getDBO();
$db->setQuery('SELECT id FROM #__users WHERE block = 0 AND activation = '.$db->Quote($token)); [2]
// Verify the token
if (!($id = $db->loadResult()))
{
$this->setError(JText::_('INVALID_TOKEN'));
return false;
}
// Push the token and user id into the session
$mainframe->setUserState($this->_namespace.'token', $token);
$mainframe->setUserState($this->_namespace.'id', $id);
return true;
}
[1] - Replace ' with empty char
[2] - If you enter ' in token field then query will be looks like : "SELECT id FROM jos_users WHERE block = 0 AND activation = '' "
Trích từ milw0rm