Hi there,
While prestashop is in the beginning of it is life, to make this software more secure and getting rid of sql injection attempts until forever you may make some minor changes in the sql functins and query types.
As you did, prestashop has already a mysql class and a query function in it, so you can make queries more secure;
In MySQL.php
public function Execute($query,$variables) { if (parent::blacklist($query)) return false; $this->_result = false;$i=1; foreach($variables as $variable){ $query = str_replace(’{’.$i.’}’,mysql_real_escape_string($variable),$query); $i++; }
if ($this->_link) { $this->_result = mysql_query($query, $this->_link); return $this->_result; } return false; }
And for queries;
$sql->execute(“SELECT falan,filan FROM falanca WHERE id = ‘{1}’ AND name = ‘{2}’ “,array($_POST[“id”],$_POST[“name”]));
and of course for insert,delete,update too. Also it is more proper to make typecasting rather than treat all inputs as a string.








