note 80615 added to function.pg-update
| From: | dominik dot bonsch at homesono dot de | Date: | Fri, 25 Jan 2008 09:24:45 +0000 |
| Subject: | note 80615 added to function.pg-update | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-135395@lists.php.net to get a copy of this message | ||
Using pg_update() and pg_insert() without key validation is not secure!
You need to check which data pairs you get, and if you want to allow to updated this column.
Example:
You have a table with tree colums: username, password, userlevel.
Your users may change only their username, and their password but not their userlevel.
If you don't filter the keys in the request array, every user can now change his userlevel just
by sending a POST Request with "userlevel=>100".
So if you don't check if the key are allowed in your request array you'll get serious sql
injection vulnarabilities in your code.
----
Server IP: 212.124.37.9
Probable Submitter: 84.163.77.49
----
Manual Page -- http://www.php.net/manual/en/function.pg-update.php
Edit -- https://master.php.net/note/edit/80615
Del: integrated -- https://master.php.net/note/delete/80615/integrated
Del: useless -- https://master.php.net/note/delete/80615/useless
Del: bad code -- https://master.php.net/note/delete/80615/bad+code
Del: spam -- https://master.php.net/note/delete/80615/spam
Del: non-english -- https://master.php.net/note/delete/80615/non-english
Del: in docs -- https://master.php.net/note/delete/80615/in+docs
Del: other reasons-- https://master.php.net/note/delete/80615
Reject -- https://master.php.net/note/reject/80615
Search -- https://master.php.net/manage/user-notes.php