Kênh 360 Công Nghệ Kênh 360 Công Nghệ

Trang chủ - PrestaShop - Giới thiệu PrestaShop - Bản cập nhật bảo mật PrestaShop v.1.3.1

Bản cập nhật bảo mật PrestaShop v.1.3.1

Bản cập nhật bảo mật PrestaShop v.1.3.1Để cập nhật lỗ hổng bảo mật này bạn có thể nâng cấp trực tiếp lên bản PrestaShop 1.3.1.

Download PrestaShop v.1.3.1 tại đây



hoặc thay đổi một số files sau

-Chú ý: sao lưu file trước khi sửa đổi.


File: /config/smarty.config.inc.php
Where: At the end of the file, before "?>"
Add: $smarty->register_modifier('secureReferrer', array('Tools', 'secureReferrer'));


File: /modules/paypalapi/error.tpl
Where: line 13
Replace: {$smarty.server.HTTP_REFERER}
By: {$smarty.server.HTTP_REFERER|secureReferrer}


File: /themes/prestashop/errors.tpl :
Where: line 9
Replace: {$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'}
By: {$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'|secureReferrer}


File: /themes/prestashop/shopping-cart.tpl :
Where: line 255
Replace: {$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'}
By: {$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'|secureReferrer}


File: /admin/login.php
Where: line 67
Replace:
$cookie->passwd = $employee->passwd;
$cookie->write();
By:
$cookie->passwd = $employee->passwd;
$cookie->remote_addr = ip2long($_SERVER['REMOTE_ADDR']);
$cookie->write();


File: /admin/confirm.php
Where: Line 22
Replace: $referer = rawurldecode(Tools::getValue('referer'));
By: $referer = Tools::htmlentitiesUTF8(rawurldecode(Tools::getValue('referer')));


File: /classes/Tools.php
Where: Line 17
After "class Tools
{"
Add these two functions:

/**
* Get the server variable SERVER_NAME
*
* @param string $referrer URL referrer
*/
static function getServerName()
{
if (isset($_SERVER['HTTP_X_FORWARDED_SERVER']) AND $_SERVER['HTTP_X_FORWARDED_SERVER'])
return $_SERVER['HTTP_X_FORWARDED_SERVER'];
return $_SERVER['SERVER_NAME'];
}

/**
* Secure an URL referrer
*
* @param string $referrer URL referrer
*/
static public function secureReferrer($referrer)
{
if (preg_match('/^http[s]?:\/\/'.self::getServerName().'\/.*$/Ui', $referrer))
return $referrer;
return __PS_BASE_URI__;
}


File: /classes/Cookie.php
Where: Line 164
Replace the function isLoggedBack() by this function:
function isLoggedBack()
{
/* Employee is valid only if it can be load and if cookie password is the same as database one */
if ($this->id_employee AND Validate::isUnsignedId($this->id_employee) AND
Employee::checkPassword(intval($this->id_employee), $this->passwd) AND (!isset($this->_content['remote_addr']) OR
$this->_content['remote_addr'] == ip2long($_SERVER['REMOTE_ADDR'])))
return true;
return false;
}


Click here to download PrestaShop v.1.3.1
Nguồn PrestaShop blog
http://www.prestashop.com/blog/article/prestashop_v131_important_security_update/
Lần cập nhật cuối ( Chủ nhật, 16 Tháng 1 2011 09:35 )  

Kênh 360 công nghệ

  • Nổi bật
  • Tin mới
  • Game mới
  • PrestaShop Guide
  • PrestaShop

Có thể bạn quan tâm

Download nhiều nhất

11/12
Download PES 2011 - FIFA 11
658
18/12
binkw32 dll
173
18/12
TeamViewerQS
47
English French German Japanese Korean