|
Brought to you by:
Suppliers of:
|
|
|
| |
"Powered by PHP and MySQL, Subdreamer provides the ability to create dynamic websites while giving full control over every section of the site. A powerful content management system with an amazing skin engine which provides users with unique and cool looking skins."
Due to flaws in the way the program filters incoming data the Subdreamer program can be made to include arbitrary SQL statement into its existing statement. |
| |
Credit:
The information has been provided by GHC team.
|
| |
Insufficient filtering of user input data can lead to SQL injection vulnerability, if the magic_quotes_gpc has been set to zero, this is due to the fact that some global arrays are not driven through addslashes() function.
Vulnerable code in script includes/core.php:
if(!get_magic_quotes_gpc()) // add slashes if gpc is off
{
$_POST = AddSlashesArray($_POST);
$_GET = AddSlashesArray($_GET);
$_COOKIE = AddSlashesArray($_COOKIE);
--[/script includes/core.php]--
As you can see the script's functions variables are defined as "global", not from global POST or GET arrays. This can lead to inadequate filtering if register_global has been set to one.
Vulnerable code in script includes/core.php:
if(function_exists('ini_get'))
{
$globalsoption = ini_get('register_globals');
}
else
{
$globalsoption = get_cfg_var('register_globals');
}
if($globalsoption != 1)
{
@extract($HTTP_SERVER_VARS, EXTR_SKIP);
@extract($HTTP_COOKIE_VARS, EXTR_SKIP);
@extract($HTTP_POST_FILES, EXTR_SKIP);
@extract($HTTP_POST_VARS, EXTR_SKIP);
@extract($HTTP_GET_VARS, EXTR_SKIP);
@extract($HTTP_ENV_VARS, EXTR_SKIP);
@extract($HTTP_SESSION_VARS, EXTR_SKIP);
}
In this case an attacker can cause an SQL injection attack through the variables that are defined as global in the function.
Example:
If we look into the vulnerable script plugins/p17_image_gallery/imagegallery.php:
function p17_DisplayImages($sectionid, $start)
{
global $DB;
global $categoryid;
global $p17_imageid;
[...]
if(isset($p17_imageid))
{
$image = $DB->query_first("SELECT * FROM p17_images WHERE imageid = '$p17_imageid'");
[...]
<td style="padding-top: 20px;" align="center"><img src="plugins/p17_image_gallery/images/'.$image['filename'].'" /></td>
You can notice that if we use the following URL we can cause an SQL injection vulnerability.
http://example/index.php?categoryid=3&p17_sectionid=1&p17_imageid=[SQL attack code]
|
| Subject:
|
Security hole corrected |
Date: |
21 Jun. 2006 |
| From: |
labrekke |
| This is a security hole that has been fixed a long time ago. Maybe reports like this should contain the version number of the application mentioned? |
|
|
|
|
|
|