Preventing sql injection

Поиск
Список
Период
Сортировка
Искать

Preventing sql injection

От:
Rick Roman <rick@cotse.net>
Дата:
I have a web application that will allow 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?

Re: Preventing sql injection

От:
Alvaro Herrera <alvherre@alvh.no-ip.org>
Дата:
On Wed, Aug 10, 2005 at 10:02:05AM -0700, Rick Roman wrote:
> I have a web application that will allow 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?

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.

-- 
Alvaro Herrera ()
"In a specialized industrial society, it would be a disaster
to have kids running around loose." (Paul Graham)

Re: Preventing sql injection

От:
Rick Roman <rick@cotse.net>
Дата:
 Alvaro Herrera wrote: 
On Wed, Aug 10, 2005 at 10:02:05AM -0700, Rick Roman wrote: 
I have a web application that will allow 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?   
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.
 
I am using PG 7.3, Java through the OBJ Object/relational bridge.

user postgres

От:
eko oke <wahyon00@yahoo.com>
Дата:


halo i have error like this :

 $psql u- abc

 

error

PSQL : FATAL IDENT authentication failed for user “xyz”

in  template1 #\c abc

: FATAL IDENT authentication failed for user “xyz”

previous connection kept

 

thank's

wahyon00.


Start your day with Yahoo! - make it your home page
FAQ