我已经使用RIPS来测试我的代码是否存在 SQL 注入威胁。这是其中之一:
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)
有人可以向我解释为什么这段代码容易受到 SQL 注入的攻击吗?我认为这要么是因为缺乏知识,要么是误报。我一直在研究,但我找不到任何新的东西,我似乎在绕圈子。