1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-31 17:02:12 +03:00
Commit Graph

2877 Commits

Author SHA1 Message Date
Tom Lane
96871fc236 Modify libpq's string-escaping routines to be aware of encoding considerations
and standard_conforming_strings.  The encoding changes are needed for proper
escaping in multibyte encodings, as per the SQL-injection vulnerabilities
noted in CVE-2006-2313 and CVE-2006-2314.  Concurrent fixes are being applied
to the server to ensure that it rejects queries that may have been corrupted
by attempted SQL injection, but this merely guarantees that unpatched clients
will fail rather than allow injection.  An actual fix requires changing the
client-side code.  While at it we have also fixed these routines to understand
about standard_conforming_strings, so that the upcoming changeover to SQL-spec
string syntax can be somewhat transparent to client code.

Since the existing API of PQescapeString and PQescapeBytea provides no way to
inform them which settings are in use, these functions are now deprecated in
favor of new functions PQescapeStringConn and PQescapeByteaConn.  The new
functions take the PGconn to which the string will be sent as an additional
parameter, and look inside the connection structure to determine what to do.
So as to provide some functionality for clients using the old functions,
libpq stores the latest encoding and standard_conforming_strings values
received from the backend in static variables, and the old functions consult
these variables.  This will work reliably in clients using only one Postgres
connection at a time, or even multiple connections if they all use the same
encoding and string syntax settings; which should cover many practical
scenarios.

Clients that use homebrew escaping methods, such as PHP's addslashes()
function or even hardwired regexp substitution, will require extra effort
to fix :-(.  It is strongly recommended that such code be replaced by use of
PQescapeStringConn/PQescapeByteaConn if at all feasible.
2006-05-21 20:20:24 +00:00
Tom Lane
2e319b0e40 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.
2006-05-21 20:11:58 +00:00
Tom Lane
8cef661bcf Update release notes. 2006-02-12 22:36:05 +00:00
Bruce Momjian
86b2da894a Update FAQ latest version 2006-02-12 18:50:26 +00:00
Bruce Momjian
dd56158eef Update release notes for 2006-02-14 release 2006-02-12 18:23:22 +00:00
Tom Lane
e9b0c2d4bd Release-note updates and copy editing. 2006-01-06 03:00:34 +00:00
Bruce Momjian
f1f15af055 New pgcrypto item wording. 2006-01-05 15:17:40 +00:00
Bruce Momjian
877ecee373 Wording improvements. 2006-01-05 15:11:33 +00:00
Bruce Momjian
f8c7c069b5 Improve markup. 2006-01-05 14:52:58 +00:00
Bruce Momjian
721205b51c *** empty log message *** 2006-01-05 05:22:09 +00:00
Bruce Momjian
12693c6476 Stamp release 7.4.11. 2006-01-05 03:59:48 +00:00
Tom Lane
c8457e0fb8 Add release notes for back branches (7.3 and up).
Also minor improvements to 8.1.1 release notes.
2005-12-09 20:40:56 +00:00
Peter Eisentraut
d45693fb55 Documentation fix: s/event_object_name/event_object_table/g 2005-12-08 20:44:18 +00:00
Bruce Momjian
48fabd257f Properly document return value of strpos(). 2005-11-16 03:56:52 +00:00
Tom Lane
31d276d0ed COPY's test for read-only transaction was backward; it prohibited COPY TO
where it should prohibit COPY FROM.  Found by Alon Goldshuv.
2005-10-03 23:43:45 +00:00
Tom Lane
fd366be49a Update release notes for pending back-branch releases. 2005-10-03 16:05:09 +00:00
Neil Conway
e3523f52f7 Fix a mistake in the documentation for SPI_getbinval(), per Michael Fuhr. 2005-09-12 18:51:29 +00:00
Tom Lane
fe88b2043a Repair error in description of nonblocking usage of PQgetCopyData().
Per Volkan Yazici.
2005-06-09 19:08:47 +00:00
Tom Lane
103376e075 Update release notes for upcoming re-releases. 2005-05-09 00:10:22 +00:00
Tom Lane
26f64e4c7a Stamp release 7.4.8. 2005-05-05 20:08:35 +00:00
Tom Lane
cff25fa049 Alter the signature for encoding conversion functions to declare the
output area as INTERNAL not CSTRING.  This is to prevent people from
calling the functions by hand.  This is a permanent solution for the
back branches but I hope it is just a stopgap for HEAD.
2005-05-03 19:18:31 +00:00
Tom Lane
510f058932 Document that only a table's owner may TRUNCATE it. Per Keith Worthington. 2005-02-22 19:06:49 +00:00
Tom Lane
6508888ded Recommend security@postgresql.org as the contact point for security-related bugs. 2005-01-30 21:32:10 +00:00
Tom Lane
9c1bb68356 Stamp release 7.4.7. 2005-01-30 19:32:22 +00:00
Tom Lane
f3610577bd We haven't had a fixed limit on rule recursion depth since 7.3 ...
but the documentation still said so.
2005-01-29 23:46:16 +00:00
Tom Lane
7447537803 Stamp release 7.4.6. 2004-10-22 00:26:24 +00:00
Tom Lane
25d1755a29 Update obsolete comments about COPY vs INSERT options, per Uwe Schroeder. 2004-10-21 22:49:04 +00:00
Tom Lane
66343dde64 Put the brackets in the right places in timestamp entries in table 8-1.
Spotted by Josh Purinton.
2004-09-18 15:28:16 +00:00
Neil Conway
6090b70ace Due to popular domand, backport fix for a typo in the SELECT reference
page, per Thomas F. O'Connell.
2004-09-13 01:59:35 +00:00
Tom Lane
63398a0381 Fix bogus example for bit-string XOR (already fixed in HEAD).
Per Grzegorz Wojdyla.
2004-09-11 16:15:26 +00:00
Tom Lane
94bb5fe888 Update release history for 7.4.5. 2004-08-18 03:03:49 +00:00
Tom Lane
17663e1aeb Stamp 7.4.4. 2004-08-15 00:24:04 +00:00
Peter Eisentraut
57bc0bf196 Override upstream DSSSL style sheet formatting changes 2004-06-29 20:46:35 +00:00
Tom Lane
27ab2e5d41 Correct erroneous table title, per Halley Pacheco de Oliveira. 2004-06-13 17:51:16 +00:00
Tom Lane
d7f5817a9b Some editorializing on 7.4.3 release notes. 2004-06-12 19:30:36 +00:00
Bruce Momjian
8d7ed778c4 Markup fix. 2004-06-12 04:08:39 +00:00
Bruce Momjian
0649d10a3b Fix markup 2004-06-12 04:03:45 +00:00
Bruce Momjian
c796e97abd Update release notes for 7.4.3. 2004-06-12 03:56:25 +00:00
Bruce Momjian
252849eb10 Add Brazilian version of FAQ.
Euler Taveira de Oliveira
2004-06-10 03:46:45 +00:00
Peter Eisentraut
aee7612fa8 Fix typo 2004-04-22 08:34:13 +00:00
Peter Eisentraut
9b6319fdd0 New link for Solaris IPC article 2004-04-22 08:31:36 +00:00
Bruce Momjian
68c4df98c5 Remove blank line in Makefile. 2004-03-09 20:10:19 +00:00
Bruce Momjian
86d7f1187a Add HISTORY/INSTALL clean target to 7.4.X. 2004-03-09 20:08:21 +00:00
Bruce Momjian
8226ed2204 Update German FAQ.
Ian Barwick
2004-03-08 17:39:04 +00:00
Tom Lane
d4e09a0fa8 Some editorial work on 7.4.2 release notes. 2004-03-07 22:08:09 +00:00
Bruce Momjian
49bc9c45c9 Brand 7.4.2. Release notes still need work. 2004-03-05 19:57:22 +00:00
Bruce Momjian
aeda110cb9 First update of release notes for 7.4.2. Still needs work. 2004-03-05 19:52:39 +00:00
Bruce Momjian
887a136572 Update Turkish FAQ, Devrim GUNDUZ 2004-03-02 15:46:34 +00:00
Tom Lane
44990772e0 Update release notes for 7.3.6. 2004-03-02 00:38:56 +00:00
Tom Lane
b6a7df8b29 Replace unportable use of /dev/stdin with lynx's -stdin switch. 2004-03-02 00:03:08 +00:00