pgsql: Add a new GUC parameter backslash_quote, which determines whether - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Add a new GUC parameter backslash_quote, which determines whether
Date
Msg-id 20060521201158.C83A19FA19B@postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Add a new GUC parameter backslash_quote, which determines whether the SQL
parser will allow "\'" to be used to represent a literal quote mark.  The
"\'" representation has been deprecated for some time in favor of the
SQL-standard representation "''" (two single quote marks), but it has been
used often enough that just disallowing it immediately won't do.  Hence
backslash_quote allows the settings "on", "off", and "safe_encoding",
the last meaning to allow "\'" only if client_encoding is a valid server
encoding.  That is now the default, and the reason is that in encodings
such as SJIS that allow 0x5c (ASCII backslash) to be the last byte of a
multibyte character, accepting "\'" allows SQL-injection attacks as per
CVE-2006-2314 (further details will be published after release).  The
"on" setting is available for backward compatibility, but it must not be
used with clients that are exposed to untrusted input.

Thanks to Akio Ishida and Yasuo Ohgaki for identifying this security issue.

Tags:
----
REL7_4_STABLE

Modified Files:
--------------
    pgsql/doc/src/sgml:
        runtime.sgml (r1.215.2.8 -> r1.215.2.9)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/runtime.sgml.diff?r1=1.215.2.8&r2=1.215.2.9)
    pgsql/src/backend/parser:
        scan.l (r1.111.2.2 -> r1.111.2.3)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/scan.l.diff?r1=1.111.2.2&r2=1.111.2.3)
    pgsql/src/backend/utils/misc:
        guc.c (r1.164.2.4 -> r1.164.2.5)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/guc.c.diff?r1=1.164.2.4&r2=1.164.2.5)
        postgresql.conf.sample (r1.92 -> r1.92.2.1)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/postgresql.conf.sample.diff?r1=1.92&r2=1.92.2.1)
    pgsql/src/bin/psql:
        tab-complete.c (r1.91.2.1 -> r1.91.2.2)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/tab-complete.c.diff?r1=1.91.2.1&r2=1.91.2.2)
    pgsql/src/include/parser:
        gramparse.h (r1.28 -> r1.28.4.1)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/gramparse.h.diff?r1=1.28&r2=1.28.4.1)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Add a new GUC parameter backslash_quote, which determines whether
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Add a new GUC parameter backslash_quote, which determines whether