Re: [HACKERS] PQescapeIdentifier - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [HACKERS] PQescapeIdentifier
Date
Msg-id 200606270249.k5R2nUw08664@momjian.us
Whole thread Raw
In response to Re: [HACKERS] PQescapeIdentifier  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > Tom Lane wrote:
> >> Have either of you inquired into the encoding-safety of this code?
> >> It certainly looks like no consideration was given for that.
>
> > I thought of that but I assume we were not accepting user-supplied
> > identifiers for this --- that this was only for application use.  Am I
> > wrong?
>
> By definition, an escaping routine is not supposed to trust the data it
> is handed.  We *will* be seeing a CVE report if this function has got
> any escaping vulnerability.
>
> If you insist on a practical example, I can certainly imagine someone
> thinking it'd be cool to allow searches on a user-selected column, and
> implementing that by passing the user-given column name straight into
> the query with only PQescapeIdentifier for safety.

OK, does someone want to fix it, or should I revert it?

--
  Bruce Momjian   bruce@momjian.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

pgsql-patches by date:

Previous
From: "Hiroshi Saito"
Date:
Subject: pg_backup_tar.c seems anerror by win32
Next
From: Bruce Momjian
Date:
Subject: Re: pg_backup_tar.c seems anerror by win32