صدور الترقيع الأمني vBulletin 3.8.7 PL3 بحيث عالجت فيه الشركة ثغرة أمنية من نوع " فلود "
الملفات المحدثة هي :
- includes/class_dm_threadpost.php
- includes/class_floodcheck.php
- includes/functions.php
- includes/init.php
- includes/version_vbulletin.php
لأصحاب الترخيص يمكنهم تحميل الترقيع الأمني من ( منطقة الأعضاء )
تنبيه : الترقية الى vb.3.8.7 PL3 مبنية على الترقية من النسخة التي تسبقها وهي vb.3.8.7 PL2
للذين لا يملكون الترخيص يمكنهم اتباع الشرح التالي من اجل الترقيع :
أولا : ملف ( class_dm_threadpost.php )
نبحث بداخله على :
نستبدله بالتالي :كود:if ($user['lastpost'] <= TIMENOW AND !can_moderate($this->info['forum']['forumid'], '', $user['userid'], $user['usergroupid'] . (trim($user['membergroupids']) ? ",$user[membergroupids]" : ''))) {
ثانيا : ملف ( class_floodcheck.php )كود:if (!can_moderate($this->info['forum']['forumid'], '', $user['userid'], $user['usergroupid'] . (trim($user['membergroupids']) ? ",$user[membergroupids]" : ''))) {
نبحث في داخله على :
نستبدله بالتالي :كود:// if we updated something, we're not flooding; otherwise, we have to wait $this->flood_wait = ($db->affected_rows() > 0 ? 0 : ($this->read_value - $floodmin_value));
كود:// if we updated something, we're not flooding; otherwise, we have to wait if ($db->affected_rows() > 0) { // we are not flooding $this->flood_wait = 0; } else { // we are flooding and have to wait $this->flood_wait = $this->read_value - $floodmin_value; if ($this->flood_wait == 0) { $db->query_write(" UPDATE " . TABLE_PREFIX . $this->table . " AS " . $this->table . " SET " . $this->read_column . " = " . $this->commit_value . " WHERE " . $this->primary_key . " = " . intval($this->key_value) . " AND " . $this->read_column . " = $floodmin_value "); if ($db->affected_rows() == 0) { // flood wait time is zero and no updated has happened, // this means another post has already been made in this second $this->flood_wait = $this->commit_value - $floodmin_value; } else { $this->flood_wait = 0; } } }
ثالثا : ملف ( functions.php )
نبحث في داخله على :
نستبدله بالتالي :كود:return 'standard_redirect("' . $phrase . '", ' . intval($forceredirect) . ');';
نبحث في داخله على :كود:return 'standard_redirect("' . $phrase . '", ' . intval($forceredirect) . ', ' . ($bypasswhitelist ? 'true' : 'false') . ');';
نستبدله بالتالي :كود:function print_standard_redirect($redir_phrase, $doquery = true, $forceredirect = false, $languageid = -1)
رابعا : ملف ( init.php )كود:function print_standard_redirect($redir_phrase, $doquery = true, $forceredirect = false, $languageid = -1, $bypasswhitelist = false)
نبحث في داخله على :
كود:if ($http_host AND $_SERVER['HTTP_REFERER']) { $http_host = preg_replace('#:80$#', '', trim($http_host)); $referrer_parts = @parse_url($_SERVER['HTTP_REFERER']); $ref_port = intval($referrer_parts['port']); $ref_host = $referrer_parts['host'] . ((!empty($ref_port) AND $ref_port != '80') ? ":$ref_port" : ''); $allowed = preg_split('#\s+#', $vbulletin->options['allowedreferrers'], -1, PREG_SPLIT_NO_EMPTY); $allowed[] = preg_replace('#^www\.#i', '', $http_host); $allowed[] = '.paypal.com'; $pass_ref_check = false; foreach ($allowed AS $host) { if (preg_match('#' . preg_quote($host, '#') . '$#siU', $ref_host)) { $pass_ref_check = true; break; } } unset($allowed); if ($pass_ref_check == false) { die('In order to accept POST request originating from this domain, the admin must add this domain to the whitelist.'); } } } }
نستبدله بالتالي :
كود:if ($http_host AND $_SERVER['HTTP_REFERER']) { $http_host = strtolower(preg_replace('#:80$#', '', trim($http_host))); $referrer_parts = @parse_url($_SERVER['HTTP_REFERER']); $ref_port = intval($referrer_parts['port']); $ref_host = strtolower($referrer_parts['host'] . ((!empty($ref_port) AND $ref_port != '80') ? ":$ref_port" : '')); if ($http_host == $ref_host) { /* Instant match is good enough no need to check anything further. */ $pass_ref_check = true; } else { $pass_ref_check = false; $allowed = array('.paypal.com'); $allowed[] = '.'.preg_replace('#^www\.#i', '', $http_host); $whitelist = preg_split('#\s+#', $vbulletin->options['allowedreferrers'], -1, PREG_SPLIT_NO_EMPTY); // Get whitelist $allowed = array_unique(is_array($whitelist) ? array_merge($allowed,$whitelist) : $allowed); // Merge and de-duplicate. foreach ($allowed AS $host) { $host = strtolower($host); if (substr($host,0,1) == '.' AND (preg_match('#' . preg_quote($host, '#') . '$#siU', $ref_host) OR substr($host,1) == $ref_host)) { $pass_ref_check = true; break; } } unset($allowed, $whitelist); } if ($pass_ref_check == false) { die('In order to accept POST requests originating from this domain, the admin must add the domain to the whitelist.'); } } } }
خامساً : ملف ( version_vbulletin.php )
نستبدل محتواه بالتالي :
هذا ولله التوفيق لنا ولكمكود:<?php define('FILE_VERSION_VBULLETIN', '3.8.7 Patch Level 3'); ?>
المصدر : سبلة الصاروج



رد مع اقتباس


مواقع النشر (المفضلة)