note 107693 added to function.mysql-real-escape-string
| From: | spam at douglasheld dot net | Date: | Mon, 27 Feb 2012 07:14:59 +0000 |
| Subject: | note 107693 added to function.mysql-real-escape-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186376@lists.php.net to get a copy of this message | ||
This is all completely approaching the security problem the wrong way. Escaping the input parameter
to fit into SQL is a blacklisting approach that invites attackers to try new combinations, character
encodings, missed assumptions etc, in order to accomplish a new SQL injection.
A whitelisting approach is better; prepared statements are generally understood to be a whitelisting
approach. You should all be using mysqli_prepare instead of all this.
I do this for my day job.
----
Server IP: 69.147.83.197
Probable Submitter: 92.236.56.145
----
Manual Page -- http://www.php.net/manual/en/function.mysql-real-escape-string.php
Edit -- https://master.php.net/note/edit/107693
Del: integrated -- https://master.php.net/note/delete/107693/integrated
Del: useless -- https://master.php.net/note/delete/107693/useless
Del: bad code -- https://master.php.net/note/delete/107693/bad+code
Del: spam -- https://master.php.net/note/delete/107693/spam
Del: non-english -- https://master.php.net/note/delete/107693/non-english
Del: in docs -- https://master.php.net/note/delete/107693/in+docs
Del: other reasons-- https://master.php.net/note/delete/107693
Reject -- https://master.php.net/note/reject/107693
Search -- https://master.php.net/manage/user-notes.php