pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: knut.suebert@web.de
To: PGSQL <pgsql-php@postgresql.org>
Subject: SQL-injection attack? (Re: Help with urlencode and rawurlencode)
Date: Wed, 16 Oct 2002 21:42:46 +0200
Message-ID: <20021016194246.GB833@fraxinus.reticulum> (raw)
In-Reply-To: <3DAAEEDA.C9FC89C6@postgresql.org>
References: <034A824BAA3FBA4CA0CBEF1031A02F3519F1FE@zablv02001.vodacom.corp>
	<3DAAEEDA.C9FC89C6@postgresql.org>

Justin Clift schrieb:
> "Duncan Adams (DNS)" wrote:
> <snip>
> > ......host_table.hostname ilike \'%omc%\' order by....
> > on the next page.
> 
> It sounds like you have the PHP variable "magic_quotes_gpc" set On in
> your "php.ini" configuration file.  If you turn this off (can't remember
> if it's possible with a function) then it will probably fix your
> problem.

Had the same problem here a few minutes ago. If you don't want to turn
off magic_quotes_gpc globally (for most things it is very useful,
IMHO), try "stripslashes()" for problematic strings.

I'm not sure, but stripping slashes could offer a possibility of
inserting "SQL-injection" attacks. Think about "'; delete from table
xyz; select '" typed into a search field. More complicated queries to
get the table names of a db could be possible. Maybe it helps, if
queries containing a ";" are rejected.

Knut Sübert



Message-ID: <20021016194246.GB833@fraxinus.reticulum>
Permalink:  ../20021016194246.GB833@fraxinus.reticulum/
Also on:    postgresql.org/message-id/20021016194246.GB833@fraxinus.reticulum

 · 

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: knut.suebert@web.de
  Subject: Re: SQL-injection attack? (Re: Help with urlencode and rawurlencode)
  In-Reply-To: <20021016194246.GB833@fraxinus.reticulum>
  References: <034A824BAA3FBA4CA0CBEF1031A02F3519F1FE@zablv02001.vodacom.corp> <3DAAEEDA.C9FC89C6@postgresql.org> <20021016194246.GB833@fraxinus.reticulum>

* 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