Re: Sql injection attacks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Geoff Caplan <geoff(at)variosoft(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Sql injection attacks
Date: 2004-07-26 15:13:01
Message-ID: 27702.1090854781@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Geoff Caplan <geoff(at)variosoft(dot)com> writes:
> Obviously, proper validation is a given for all kinds of reasons. But
> the problem with validation/escaping as the primary defense against
> injection seems to be that simply escaping would not catch every type
> of insertion via strings.

I think you misunderstood. Escaping is perfectly safe (given a correct
escaping function) if it's used on *every* untrustworthy input string.
The argument for the "keep data separate from code" approach is
essentially just that it's easier to be sure you haven't forgotten
anyplace where you need to escape.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Geoff Caplan 2004-07-26 15:33:31 Re: Sql injection attacks
Previous Message Lincoln Yeoh 2004-07-26 14:35:07 Re: Sql injection attacks