From 9bc62ddd5f0581998730d763390f5412fba8336b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 21 May 2006 20:11:25 +0000 Subject: 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. --- src/backend/utils/misc/postgresql.conf.sample | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/utils/misc/postgresql.conf.sample') diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 021b732096d..61d0bfebf3f 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -311,9 +311,10 @@ # - Previous Postgres Versions - #add_missing_from = true +#backslash_quote = safe_encoding # on, off, or safe_encoding +#default_with_oids = true #regex_flavor = advanced # advanced, extended, or basic #sql_inheritance = true -#default_with_oids = true # - Other Platforms & Clients - -- cgit v1.2.3