閱讀了幾乎所有的帖子,但無法判斷我的程序是否易受傷害?任何幫助表示讚賞。以下MySql存儲過程是否容易受到sql注入?
1)調用過程爲:
$query = ($is_mine?'call dispatch.dis_get_my_assigned_tasks("'.$username.'");'
步驟:
CREATE DEFINER=`test`@`localhost` PROCEDURE `dis_get_all_assigned_tasks`()
BEGIN
select distinct at_id, at_issues, at_location, at_room_number, user_fname,
from dispatch.dis_assigned_tasks
left outer join dispatch.dis_users
on user_id = at_user
order by at_location, at_user_pickup_timestamp desc;
END
2)調用方法如:
$query = "call dispatch.dis_get_user_info('".$username."');";
步驟:
CREATE DEFINER=`test`@`localhost` PROCEDURE `dis_get_user_info`(IN username VARCHAR(45))
BEGIN
select * from dispatch.dis_users where user_username = username;
END
這是沒有安全審查服務。如果您擔心這些查詢中存在特定問題,請告知我們您的想法是哪一個。 – hakre
可能的重複[如何防止SQL注入PHP?](http://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php) – hakre
看起來像它測試與'看看它是不是.. –