14

Lỗ hổng nguy hiểm của Joomla 1.5

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

No comments

Add your comment

Google Friend Connect (leave a quick comment)
Loading
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><a><embed><br><p>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <html>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

Syndicate

Syndicate content