Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | [UNIX] Subdreamer SQL Injection |
|---|---|
| Date: | 22 Mar 2005 17:39:17 +0200 |
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 - - - - - - - - - Subdreamer SQL Injection ------------------------------------------------------------------------ SUMMARY "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. DETAILS 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] ADDITIONAL INFORMATION The information has been provided by <mailto:foster@ghc.ru> GHC team. ======================================== 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: list-unsubscribe@securiteam.com In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com ==================== ==================== 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.
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [EXPL] phpBB UID Exploit (Perl Exploit 2), SecuriTeam |
|---|---|
| Next by Date: | [NEWS] Buffer Overflow In Soldier Of Fortune II, SecuriTeam |
| Previous by Thread: | [EXPL] phpBB UID Exploit (Perl Exploit 2), SecuriTeam |
| Next by Thread: | [NEWS] Buffer Overflow In Soldier Of Fortune II, SecuriTeam |
| Indexes: | [Date] [Thread] [Top] [All Lists] |