GET parameters vulnerable to SQL Injection - PHP

后端 未结 5 850
长情又很酷
长情又很酷 2020-12-21 08:05

I\'ve been asked to handle a security issue for a site which was set up by another programmer. As of yet, I haven\'t seen any of the code, so I\'m going off of assumptions a

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-21 08:17

    Yes, mysql_real_escape_string() will escape any potentially hazardous characters. If you know that the arguments are numeric, it would not hurt to verify this aswell using is_numeric()

    You should also look at mysql::prepare -- This will ensure that only 1 statement is executed, and prevent additional SQL vulnerabilities.

提交回复
热议问题