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

From Gregory Stark
Subject Re: Protection from SQL injection
Date
Msg-id 87bq3qm5b7.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Protection from SQL injection  (Andrew Sullivan <ajs@commandprompt.com>)
Responses Re: Protection from SQL injection  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Andrew Sullivan" <ajs@commandprompt.com> writes:

> The _principal_ trick with SQL injection is to fool the application
> into somehow handing a ";" followed by an arbitrary SQL statement.
> There are of course other things one can do, but most of them are
> constrained to abuse of statements your application already performs.
> This injection problem, on the other hand, allows an attacker to do
> whatever they want.

They're the principal trick only because they're the most convenient. If you
block them (as you can today by using PQExecParams() !!!) then people will
switch to other things.

c.f. 

http://www.areino.com/hackeando/

(there is a semicolon here but that's a microsoft-ism, postgres would actually
be more affected by this style of attack without the semicolon)

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's Slony Replication
support!


pgsql-hackers by date:

Previous
From: Andrew Chernow
Date:
Subject: Re: Odd timezone backend output
Next
From: Andrew Dunstan
Date:
Subject: Re: Odd timezone backend output