Re: SQL injection, php and queueing multiple statement
От
Chris Browne
Тема
Re: SQL injection, php and queueing multiple statement
Дата
Msg-id
60lk3kw3co.fsf@dba2.int.libertyrms.com
Список
Дерево обсуждения
Re: SQL injection, php and queueing multiple statement Chris Browne <cbbrowne@acm.org>
mail@webthatworks.it (Ivan Sergio Borgonovo) writes:
> Is there a switch (php side or pg side) to avoid things like:
>
> pg_query("select id from table1 where a=$i");
>
> into becoming
>
> pg_query("select id from table1 where a=1 and 1=1; do something
> nasty; -- ");
>
> So that every
> pg_query(...) can contain no more than one statement?
The conventional approach to this sort of thing is to use prepared
statements:
http://ca3.php.net/manual/en/function.pg-prepare.php
In effect, you set up the query beforehand, pre-parameterizing.
Assuming that PHP is actually using PostgreSQL prepared statements
(and not just faking things behind your back), this should nicely
address the problem of injection attacks.
--
(reverse (concatenate 'string "ofni.sesabatadxunil" "@" "enworbbc"))
http://linuxfinances.info/info/linuxdistributions.html
The average woman would rather have beauty than brains because the
average man can see better than he can think.
В списке pgsql-general по дате отправления
От: Ivan Sergio Borgonovo
Дата: