From: Tom Lane <tgl@sss.pgh.pa.us>
To: Scott Marlowe <scott.marlowe@gmail.com>
Cc: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Protection from SQL injection
Date: Sat, 26 Apr 2008 23:42:14 -0400
Message-ID: <13670.1209267734@sss.pgh.pa.us> (raw)
In-Reply-To: <dcc563d10804261721l68d7dcd1u329d796a8aa8a9b4@mail.gmail.com>
References: <5f211bd50804260932l7a63618jca64858271ff269f@mail.gmail.com>
<fv0727$cge$1@ger.gmane.org>
<dcc563d10804261721l68d7dcd1u329d796a8aa8a9b4@mail.gmail.com>
"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.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, scott.marlowe@gmail.com, spam_eater@gmx.net
Subject: Re: Protection from SQL injection
In-Reply-To: <13670.1209267734@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox