Re: Preventing sql injection

Поиск
Список
Период
Сортировка
От Rick Roman
Тема Re: Preventing sql injection
Дата
Msg-id 42FA35F6.4060900@cotse.net
обсуждение исходный текст
Ответ на Re: Preventing sql injection  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы user postgres  (eko oke <wahyon00@yahoo.com>)
Список pgsql-admin
Alvaro Herrera wrote: <blockquote cite="mid20050810171108.GF7871@alvh.no-ip.org" type="cite"><pre wrap="">On Wed, Aug
10,2005 at 10:02:05AM -0700, Rick Roman wrote: </pre><blockquote type="cite"><pre wrap="">I have a web application that
willallow users to submit comments. The  
database activity consists of a single insert statement into a comments
table. I want to lock down this operation against sql injection attacks.
Can someone point me to a discussion of general principles? I've seen
reference to V3 extended-query protocol. Where is this invoked? Other
suggestions?   </pre></blockquote><pre wrap="">
What language are you using?

The general principle is that you have to look user input for certain
chars, such as ' and \, and escape them somehow.

There's another way, which is using new features of the v3 protocol.
One easy way to do that is using PQexecParams() instead of PQexec(), if
you are dealing with C programs.
 </pre></blockquote> I am using PG 7.3, Java through the OBJ Object/relational bridge.<br />

В списке pgsql-admin по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Preventing sql injection
Следующее
От: "josh@segrestfarms.com"
Дата:
Сообщение: Re: SQL Server 2000 to PostgreSQL 8.0.3