IndexScript Forum  

Go Back   IndexScript Forum > IndexScript > IndexScript - Directory Script
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-26-2007, 02:49 PM
hakon hakon is offline
Administrator
 
Join Date: Jan 2006
Posts: 1,682
Default indexscript sql injection hole fix

following from this thread: http://www.indexscript.com/forum/showthread.php?t=2260 - i'm posting a consolidated fix in this thread for the sql injection security hole exploited today:


if you are using v2.8 and have not modified your utils.php file found in the include folder:
1. you can simply download the utils.php attached in this post for v2.8 and replace your existing one with it


if you are using v2.7 and have not modified your utils.php file found in the include folder:
1. you can simply download the utils.php attached in this post for v2.7 and replace your existing one with it


if you want to perform a manual replace:
1. open up your utils.php in the include folder
2. look for:
Code:
function fnpreparesql($field) {
  if(!get_magic_quotes_gpc()) {
    return mysql_real_escape_string($field);
  }
  else {
    return $field;
  }
}
and replace with:
Code:
function fnpreparesql($field) {
  if(get_magic_quotes_gpc()) {
    $temp = stripslashes($field);
  }
  else {
    $temp = $field;
  }

  if(stristr($temp, "dir_login")) {
    $temp = "";
  }

  return mysql_real_escape_string($temp);
}
look for all instances of:
Code:
= " . $cat_id
and replace with:
Code:
= " . fnpreparesql($cat_id)
look for all instances of:
Code:
= " . $start_id
and replace with:
Code:
= " . fnpreparesql($start_id)
look for all instances of:
Code:
= " . $row['parent_id']
and replace with:
Code:
= " . fnpreparesql($row['parent_id'])
look for all instances of:
Code:
= " . $row['cat_id']
and replace with:
Code:
= " . fnpreparesql($row['cat_id'])
Attached Files
File Type: zip utils-v2.8.zip (2.6 KB, 42 views)
File Type: zip utils-v2.7.zip (2.2 KB, 14 views)
__________________
Get your IndexScript skins HERE
Some other interesting sites: Pneumococcal Diseases | Learn about Colic | Pregnancy Articles | Humor Portal

Last edited by hakon : 07-26-2007 at 05:38 PM. Reason: consolidate fix into a single thread
Reply With Quote
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 06:16 AM.



Same Author: URL Shortening Script ]

Partners: IT Support Blog | Free Games | iWebzen Web Directory | PR Home Pages Web Directory ]





Powered by vBulletin® Version 3.6.9
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.