Hello
I have PHP script but I found 18 SQL injection in one file only
How I fix this problems?
Thank you
I have PHP script but I found 18 SQL injection in one file only
How I fix this problems?
Thank you
Last edited:
nasaboy007 said:use the function mysql_real_escape_string() around EVERY variable you pass into mysql_query(), especially if it's a user-input (like $_POST or $_GET)
$rs_query=mysql_query("Select * from sbwmd_categories where id=" . $category );
$rs_query=mysql_query("Select * from sbwmd_categories where id=" . mysql_real_escape_string($category) );
Peter said:in what way is it not working?
the function used does stop tainting the database.
$rs_query=mysql_query("Select * from sbwmd_categories where id=" . mysql_real_escape_string($cid) )
$rs_query=mysql_query("Select * from sbwmd_categories where id=" . mysql_real_escape_string($rs["pid"]) );
$rst1_query=mysql_query("Select * from sbwmd_categories where pid IN (" . mysql_real_escape_string($clist) . ") and id not in ( ". mysql_real_escape_string($clist) . ")") ;
$id = $_GET['category'];// for example
// Remove non numeric
$id = preg_replace('/([^0-9]+)/', '', $id);
// Intval'ed it
$id = intval($id);
// Use it for query, etc
Acunetix Web Vulnerability Scanner 5Jim_ said:How are you testing these SQL injection holes? Just curious.
It's possible that the software is getting a false positive and not recognizing that sanitation function.
I agree with false positive alarm.awal said:Acunetix Web Vulnerability Scanner 5
http://www.acunetix.com/