Re: ISO guidelines/strategies to guard injection attacks

From: Andy Colson <andy(at)squeakycode(dot)net>
To: Kynn Jones <kynnjo(at)gmail(dot)com>, PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: ISO guidelines/strategies to guard injection attacks
Date: 2010-01-19 21:39:54
Message-ID: 4B5626AA.1020904@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/19/2010 3:23 PM, Kynn Jones wrote:
> I have a Perl CGI script (using DBD::Pg) that interfaces with a
> server-side Pg database. I'm looking for general
> guidelines/tools/strategies that will help me guard against SQL
> injection attacks.
>
> Any pointers/suggestions would be much appreciated.
>
> ~K
>

prepare your queries:

my $q = $db->prepare('select something from table where key = $1');
$q->execute(42);

and..
$db->do('update table set field = $1 where key = $2', undef, 'key', 42);

(*guessed at the do(). I think there is an undef in there, or something*)

-Andy

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Devrim GÜNDÜZ 2010-01-19 21:44:50 Re: changing log_min_duration_statement
Previous Message Ben Chobot 2010-01-19 21:27:47 changing log_min_duration_statement