pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Ryan <chris@greatbridge.com>
To: s <stefang@bundabergcity.qld.gov.au>
Cc: pgsql-php@postgresql.org
Subject: Re: query checking
Date: Mon, 22 Jan 2001 08:44:55 -0500
Message-ID: <3A6C3957.BE9D921E@greatbridge.com> (raw)
References: <3A6B8264.5040902@bundabergcity.qld.gov.au>

	Probably the most direct way to look for and catch such attempts would
be to search for the semi-colon ';' and if it exists just give an error.

Chris Ryan
chris@greatbridge.com

s wrote:
> 
> I am writing a site that
> does select/insert SQL commands with users input.
> 
> There is a potential hazard if some one tries to execute there
> own commands in an input box
> eg.    the user types into the input  box on a form  -   [ "; delete *
> from table; ]
> 
> I'm after a regular expression (that'd be nice) or an algorithm to
> tell that only one query is being passed to psql at a time.
> 
> The query string will be processed if
> Either - one SELECT command only
>            - one INSERT command only
>            - one UPDATE command only
> ELSE - dont process query
> 
> Any input would be much appreciated.
> thanks,
> stef



view thread (5+ messages)  latest in thread

Message-ID: <3A6C3957.BE9D921E@greatbridge.com>
Permalink:  ../3A6C3957.BE9D921E@greatbridge.com/
Also on:    postgresql.org/message-id/3A6C3957.BE9D921E@greatbridge.com

 · 

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-php@postgresql.org
  Cc: chris@greatbridge.com, stefang@bundabergcity.qld.gov.au
  Subject: Re: query checking
  In-Reply-To: <3A6C3957.BE9D921E@greatbridge.com>
  References: <3A6B8264.5040902@bundabergcity.qld.gov.au> <3A6C3957.BE9D921E@greatbridge.com>

* 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