Secure Programming in PHP by Akash Mahajan
Secure Programming in PHP by Akash Mahajan
in PHP
Akash Mahajan | Web Security Consultant
Speaking at BPU G on 24th April 2010
Akash Mahajan | About Me
mysql_real_escape_string()
$dbquery = sprintf(“SELECT name FROM user WHERE
id=‘%s’”, mysql_real_escape_string(‘id’));
Parameterized queries
$res = $query(“SELECT name FROM user WHERE id=?”, $id);
Standard mysql module in PHP doesn’t allow for
parameterized queries. You need mysqli
Stored Procedures
See a kickass example of stored proc used to hack more than
hundred thousand websites
▪ http://www.breach.com/resources/breach-security-labs/alerts/mass-
sql-injection-attack-evolutio
File Uploads