I tried to find some SQL injection exploits that could bypass functions that should prevent sql injection vulnerabilities, for example mysql_real_escape_string
. I found an exploit and the author described the vulnerability and posted the vulnerable code:
<?php
if(isset($_GET['pagename'])){
$name=$_GET['pagename'];
$query=sprintf("SELECT* FROM ".PREFIX."page WHERE
pagename = '%s' AND publish = 'Y'",$xx_con->real_escape_string($name));
}
But he did not describe how to bypass the protection, i.e. the function real_escape_string
. Is there a real SQLi vulnerability in the code and how could an attacker exploit it?