SQL injection search
11–20 of 114 posts
Re: SQL injection search
#12Re: SQL injection search
#13 $result = mysql_query('DELETE FROM saves WHERE id = '.(int)$_GET['delete']);Re: SQL injection search
#14Using unsanitized $_GET is the least of their problems considering mysql_* is deprecated.
Re: SQL injection search
#15mysql_query is deprecated... use MySQLi or PDO
Re: SQL injection search
#16Nice example, but not all are insecure. For example, the second one here is: $result = mysql_query('DELETE FROM saves WHERE id = '.(int)$_GET['delete']);
Re: SQL injection search
#17Nice example, but not all are insecure. For example, the second one here is: $result = mysql_query('DELETE FROM saves WHERE id = '.(int)$_GET['delete']);
While there's nothing technically wrong with the example given, I might argue that since that won't work in all cases, it might be better to enforce a more rigorous policy of SQL query cleansing, or using bound params. Although this example is so simple I might not.
Then again, the fact that $_GET is even available at the location the query is taking place means this is most likely a type of design that I abhor, that PHP makes easy. Put actions in functions or methods, and then call them.
Re: SQL injection search
#18Re: SQL injection search
#19Re: SQL injection search
#20While we are at it.. XSS search: https://github.com/search?q=extension%3Aphp+%3C%3F%3D%24_GET...