pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rick Roman <rick@cotse.net>
To: pgsql-admin@postgresql.org
Subject: Re: Preventing sql injection
Date: Wed, 10 Aug 2005 10:14:30 -0700
Message-ID: <42FA35F6.4060900@cotse.net> (raw)
In-Reply-To: <20050810171108.GF7871@alvh.no-ip.org>
References: <42FA330D.7020908@cotse.net>
	<20050810171108.GF7871@alvh.no-ip.org>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Alvaro Herrera wrote:
<blockquote cite="mid20050810171108.GF7871@alvh.no-ip.org" type="cite">
  <pre wrap="">On Wed, Aug 10, 2005 at 10:02:05AM -0700, Rick Roman wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">I have a web application that will allow users to submit comments. The 
database activity consists of a single insert statement into a comments 
table. I want to lock down this operation against sql injection attacks. 
Can someone point me to a discussion of general principles? I've seen 
reference to V3 extended-query protocol. Where is this invoked? Other 
suggestions?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
What language are you using?

The general principle is that you have to look user input for certain
chars, such as ' and \, and escape them somehow.

There's another way, which is using new features of the v3 protocol.
One easy way to do that is using PQexecParams() instead of PQexec(), if
you are dealing with C programs.

  </pre>
</blockquote>
I am using PG 7.3, Java through the OBJ Object/relational bridge.<br>
</body>
</html>



view thread (3+ messages)

Message-ID: <42FA35F6.4060900@cotse.net>
Permalink:  ../42FA35F6.4060900@cotse.net/
Also on:    postgresql.org/message-id/42FA35F6.4060900@cotse.net

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: rick@cotse.net
  Subject: Re: Preventing sql injection
  In-Reply-To: <42FA35F6.4060900@cotse.net>
  References: <42FA330D.7020908@cotse.net> <20050810171108.GF7871@alvh.no-ip.org> <42FA35F6.4060900@cotse.net>

* 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