VBsupport перешел с домена .ORG на родной .RU
Ура!
Пожалуйста, обновите свои закладки - VBsupport.ru
Блок РКН снят, форум доступен на всей территории России, включая новые терртории, без VPN
На форуме введена премодерация ВСЕХ новых пользователей
Почта с временных сервисов, типа mailinator.com, gawab.com и/или прочих, которые предоставляют временный почтовый ящик без регистрации и/или почтовый ящик для рассылки спама, отслеживается и блокируется, а так же заносится в спам-блок форума, аккаунты удаляются
Если вы хотите приобрести какой то скрипт/продукт/хак из каталогов перечисленных ниже: Каталог модулей/хаков
Ещё раз обращаем Ваше внимание: всё, что Вы скачиваете и устанавливаете на свой форум, Вы устанавливаете исключительно на свой страх и риск.
Сообщество vBSupport'а физически не в состоянии проверять все стили, хаки и нули, выкладываемые пользователями.
Помните: безопасность Вашего проекта - Ваша забота. Убедительная просьба: при обнаружении уязвимостей или сомнительных кодов обязательно отписывайтесь в теме хака/стиля
Спасибо за понимание
Прочла пост на офсайте
посмотрела файлик vbv_14079_14084_fix.php
это афигенно...
Пятёрошники, мои соболезнования...
@BTC
СпециалистЪ
Join Date: Aug 2013
Posts: 727
Версия vB: 3.8.x
Reputation:
Knowing 240
Репутация в разделе: 62
0
Luvilla, А можно сюда его?) Чисто поглядеть)
@Liked
Специалист
Join Date: Dec 2012
Posts: 1,158
Версия vB: 4.2.х
Пол:
Reputation:
Professional 491
Репутация в разделе: 20
0
Какого хрена они выпускают новые версии движка, если эксплойты на эту ветку обнаруживаются каждый месяц.
Неужели, им пофигу на репутацию продукта? Никто же не будет покупать их говнецо.
$fix = new FixVbv14079And14084();
$params = $fix->step_1($_GET);
if (!empty($params))
{
?>
<script type="text/javascript">
(function()
{
window.setTimeout(function()
{
var loc = window.location.href;
if (loc.match(/startat=\d+/))
{
loc = loc.replace(/startat=\d+/, "startat=<?php echo $params['startat']; ?>");
}
else
{
var argChar = loc.match(/\?/) ? '&' : '?';
loc = loc + argChar + "startat=<?php echo $params['startat']; ?>";
}
window.location.href = loc;
}, 1000);
})();
</script>
<?php
}
class FixVbv14079And14084
{
/**
* Prints a message
* @param string Message
*/
protected function show_message($message)
{
echo $message . "<br />\n";
}
/**
* The step_1 function ported from the 515b2 upgrade
*/
public function step_1($data = null)
{
$startat = (int) isset($data['startat']) ? $data['startat'] : 0;
$batchsize = 100;
$assertor = vB::getDbAssertor();
$this->show_message('Cleaning attachment filenames and settings.');
// For each attachment, we need to:
// 1. html escape the attachment filename, if not already escaped (VBV-14084)
// 2. pull data from settings without using unserialize, then re-serialize it
// to mitigate the PHP unserialize object injection vulnerability (VBV-14079)
// 3. check that the author has 'canattachmentcss' for in this channel, and
// if not, blank out the settings[styles] value that they don't have
// permission to set. This mitigates the XSS vulnerability. (VBV-14079)
// get attach records
$rows = $assertor->getRows('vBInstall:getAttachmentsWithParentAndAuthor', array(
'startat' => (int) $startat,
'batchsize' => (int) $batchsize,
));
$rowcount = count($rows);
if ($rowcount == 0)
{
vB_Cache::resetCache();
$this->show_message('Cache cleared.');
// done
$this->show_message('Process finished.');
return;
}
else
{
// make changes
foreach ($rows AS $row)
{
// Escape filenames (VBV-14084)
$updates = array();
if ($row['filename'] === vB_String::unHtmlSpecialChars($row['filename']))
{
// unescaping didn't change anything, so this filename may need to be escaped
$escaped = vB_String::htmlSpecialCharsUni($row['filename']);
if ($escaped !== $row['filename'])
{
// there was a change, need to save it
$updates['filename'] = $escaped;
}
}
if (!empty($row['settings']))
{
// ensure that settings contains only valid serialized
// data we are expecting. parseAttachSettings will fail
// if there is anything unexpected such as a serialized
// object.
$settings = $this->parseAttachSettings($row['settings']);
// remove settings['styles'] if the user doesn't have
// 'canattachmentcss' (VBV-14079)
$usercontext = vB::getUserContext($row['userid']);
if (!$usercontext->getChannelPermission('forumpermissions', 'canattachmentcss', $row['nodeid']))
{
// user doesn't have the permission for this node
$settings['styles'] = '';
}
$settings = serialize($settings);
if ($settings !== $row['settings'])
{
$updates['settings'] = $settings;
}
}
if (!empty($updates))
{
// save any changes....
$assertor->update('vBForum:attach', $updates, array('nodeid' => $row['nodeid']));
}
}
// return for next batch
return array('startat' => $startat + $batchsize);
}
}
/**
* Internal function used by step_1 to safely parse serialized data
* without the risk of trying to instantiate serialized objects, etc.
* This is *not* a full unserialize function, it *only* handles the
* data that we expect to be in the settings field, in the format that
* we expect, namely an array of specific strings.
*
* @param string Serialized array of settings
* @return array The unserialized array of settings, checked against
* a whitelist, OR an empty array of any unexpected
* data was found
*/
protected function parseAttachSettings($settings)
{
// expect an array
if (!preg_match('#^a:(\d+):{(.+)}$#', $settings, $matches))
{
return array();
}
// each array element should have a string key and a string or int value
for ($i = 0; $i < $count; ++$i)
{
// get key length
if (!preg_match('#^s:(\d+):#', $elementString, $matches))
{
return array();
}
$keyLen = $matches[1];
$matchLen = strlen($matches[0]);
$elementString = substr($elementString, $matchLen);
$key = (string) substr($elementString, 1, $keyLen); // 1 to advance past the opening quote (")
$elementString = substr($elementString, $keyLen + 3); // +3 to account for the quotes ("") and ending (;)
// get value
if (!preg_match('#^(s|i):#', $elementString, $matches))
{
return array();
}
$type = $matches[1];
if ($type == 's')
{
if (!preg_match('#^s:(\d+):#', $elementString, $matches))
{
return array();
}
$valueLen = $matches[1];
$matchLen = strlen($matches[0]);
$elementString = substr($elementString, $matchLen);
$value = (string) substr($elementString, 1, $valueLen); // 1 to advance past the opening quote (")
$elementString = substr($elementString, $valueLen + 3); // +3 to account for the quotes ("") and ending (;)
}
else // 'i'
{
if (!preg_match('#^i:(\d+);#', $elementString, $matches))
{
return array();
}
$value = (int) $matches[1];
$matchLen = strlen($matches[0]);
$elementString = substr($elementString, $matchLen);
}