Re: Protection from SQL injection - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: Protection from SQL injection
Date
Msg-id dcc563d10804262050u3da9f7f8n66bc30596ba63772@mail.gmail.com
Whole thread Raw
In response to Re: Protection from SQL injection  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Protection from SQL injection  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Protection from SQL injection  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
List pgsql-sql
On Sat, Apr 26, 2008 at 9:42 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Scott Marlowe" <scott.marlowe@gmail.com> writes:
>  > Wouldn't it be much simpler to have a version of the libpq client lib
>  > that only understands prepared queries?
>
>  You could do that, but there's still no way for it to know exactly how
>  the submitted query was constructed.  This would block off the types of
>  injections that want to add whole SQL commands, but not ones that just
>  subvert the current query (eg adding OR TRUE to see data you shouldn't).
>
>  This is really a client problem and only client-side solutions will
>  provide meaningful traction for it.  In perl, for instance, the "taint"
>  mechanism is a good way to notice whether any insecure strings are
>  getting into database queries.

Agreed.  My point was that to do what the OP wants, wouldn't it make
more sense to just lobotomize libpq so it doesn't understand anything
but prepared queries.  Doesn't obviate the need for a client side
language based solution.  Just seems to make WAY more sense than
trying to make the change at the server level in pgsql.


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Protection from SQL injection
Next
From: Tom Lane
Date:
Subject: Re: Protection from SQL injection