我正在使用 PHP 程序 RIPS ( http://rips-scanner.sourceforge.net/ ) 来扫描我的 PHP 脚本中的漏洞,它会返回消息
Userinput reaches sensitive sink due to insecure usage of addslashes() without quotes Userinput reaches sensitive sink due to insecure usage of addslashes() without quotes
addlashes 的不安全使用是什么意思?如何保护下面的代码?
47: mysql_query $sql = mysql_query("INSERT INTO questions_answers(PID, Name, Email, Question, Date) VALUES ('$product_ID', '$name', '$email', '$question', '$date') ") or mydie ("Error" . mysql_error() . " File: " . __FILE__ . " on line: " . __LINE__);
4: $product_ID = addslashes($_GET['product_id']);
38: $name = addslashes(strip_tags($name));
34: $name = ucwords($name);
21: $name = '';
5: $name = addslashes($_POST['name']);
40: $email = addslashes(strip_tags($email));
14: $email = '';
6: $email = addslashes($_POST['email']);
39: $question = addslashes(strip_tags($question));
35: $question = ucfirst($question);
7: $question = addslashes($_POST['question']);
36: $date = time();
注意:这是 RIPS 的输出,注意应该从下往上读取的行号。