I have used RIPS to test my code for SQL injection threats. And this is one of them that has come up:
Userinput reaches sensitive sink due to insecure usage of mysql_real_escape_string() without quotes (Blind exploitation)
370: mysql_query mysql_query("INSERT INTO `members` (`Username`, `Password`, `Name`, `AccessLevel`, `LastLogin`) VALUES ('" . mysql_real_escape_string($user) . "', '" . mysql_real_escape_string($pass) . "', '" . mysql_real_escape_string($fuln) . "', '" . mysql_real_escape_string($al) . "', '" . mysql_real_escape_string($now) . "');");
364: $user = htmlentities($_POST['user'], ENT_QUOTES);
365: $pass = htmlentities(md5($_POST['pass']), ENT_QUOTES);
366: $fuln = htmlentities($_POST['fuln'], ENT_QUOTES);
367: $al = htmlentities($_POST['al'], ENT_QUOTES);
368: $now = time();
requires:
359: if($action == "newadmin")
360: if($memberinfo['AccessLevel'] == 3)
363: if($_GET['submit'] == "new")
369: if($user && $pass && $fuln)
Could someone please explain to me why this code would be vulnerable to SQL injection? I think it is either because of lack of knowledge or it is a false positive. I have been researching but I cannot find out anything new and I seem to be going in circles.