Re: Prepared Statements - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Prepared Statements
Date
Msg-id Pine.LNX.4.33.0307220149200.14671-100000@leary.csoft.net
Whole thread Raw
In response to Re: Prepared Statements  (Peter Kovacs <peter.kovacs@siemens.com>)
List pgsql-jdbc

On Mon, 21 Jul 2003, Peter Kovacs wrote:

> I think that the simplest thing would be to have an option in the
> backend to disable processing of multiple statements in one query --
> i.e. disallow the use of ';' as a separator of statements. I am not sure
> why this feature (multiple statments in one query) is there anyway.
> "Reduce network roundtrips" is the usual reply, but, then, what is the
> purpose of stored procedures (functions in PostgreSQL)?
>

>  From this perspective, the whole wrestling with "drop table..." and
> similar risks seem farily vain to me. At least, the driver is not the
> place to solve this kind of security problems which basically exist due
> to the wya the server behaves. Instead, the question should be asked: is
> the behaviour of the server optimal?. Do we need this feature
> (processing multiple, semi-colon separated statements)? Should not this
> feature be eventually optional?

The second statement type of attack is just one variant.  Consider a query
that displayed a list of your orders.  SELECT * FROM orders WHERE
userid='username'.  Suppose I substituted a username of username' OR
true OR userid='.  This is another injection attack that does not
require the backend to support multiple statements per query.

Kris Jurka


pgsql-jdbc by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: Prepared Statements
Next
From: Barry Lind
Date:
Subject: Patch applied for SQL Injection vulnerability for setObject(int,Object,int)