Go to file
Tom Lane a4b0c0aaf0 Prevent access to external files/URLs via XML entity references.
xml_parse() would attempt to fetch external files or URLs as needed to
resolve DTD and entity references in an XML value, thus allowing
unprivileged database users to attempt to fetch data with the privileges
of the database server.  While the external data wouldn't get returned
directly to the user, portions of it could be exposed in error messages
if the data didn't parse as valid XML; and in any case the mere ability
to check existence of a file might be useful to an attacker.

The ideal solution to this would still allow fetching of references that
are listed in the host system's XML catalogs, so that documents can be
validated according to installed DTDs.  However, doing that with the
available libxml2 APIs appears complex and error-prone, so we're not going
to risk it in a security patch that necessarily hasn't gotten wide review.
So this patch merely shuts off all access, causing any external fetch to
silently expand to an empty string.  A future patch may improve this.

In HEAD and 9.2, also suppress warnings about undefined entities, which
would otherwise occur as a result of not loading referenced DTDs.  Previous
branches don't show such warnings anyway, due to different error handling
arrangements.

Credit to Noah Misch for first reporting the problem, and for much work
towards a solution, though this simplistic approach was not his preference.
Also thanks to Daniel Veillard for consultation.

Security: CVE-2012-3489
2012-08-14 18:33:05 -04:00
config Don't reject threaded Python on FreeBSD. 2012-02-20 16:21:52 -05:00
contrib Fix some more bugs in contrib/xml2's xslt_process(). 2012-06-04 20:13:07 -04:00
doc Update copyright year in forgotten places 2012-06-19 21:32:51 +03:00
src Prevent access to external files/URLs via XML entity references. 2012-08-14 18:33:05 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:12 +02:00
aclocal.m4
configure Stamp 8.3.19. 2012-05-31 19:14:08 -04:00
configure.in Stamp 8.3.19. 2012-05-31 19:14:08 -04:00
COPYRIGHT Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
GNUmakefile.in Back-patch creation of tar.bz2 tarball during "make dist". 2011-07-03 16:40:34 -04:00
Makefile
README Update libpqxx URL in top-level README, per Gurjeet Singh. 2008-03-05 17:04:42 +00:00
README.git Back-patch replacement of README.CVS with README.git. 2010-09-21 14:43:11 -04:00

PostgreSQL Database Management System
=====================================
  
This directory contains the source code distribution of the PostgreSQL
database management system.

PostgreSQL is an advanced object-relational database management system
that supports an extended subset of the SQL standard, including
transactions, foreign keys, subqueries, triggers, user-defined types
and functions.  This distribution also contains C language bindings.

PostgreSQL has many language interfaces including some of the more
common listed below:

C++ - http://pqxx.org/development/libpqxx/
JDBC - http://jdbc.postgresql.org
ODBC - http://odbc.postgresql.org
Perl - http://search.cpan.org/~dbdpg/
PHP - http://www.php.net
Python - http://www.initd.org/
Ruby - http://ruby.scripting.ca/postgres/

Other language binding are available from a variety of contributing
parties.

PostgreSQL also has a great number of procedural languages available,
a short, incomplete list is below:

PL/pgSQL - included in PostgreSQL source distribution
PL/Perl - included in PostgreSQL source distribution
PL/PHP - http://projects.commandprompt.com/projects/public/plphp
PL/Python - included in PostgreSQL source distribution
PL/Java - http://pgfoundry.org/projects/pljava/
PL/Tcl - included in PostgreSQL source distribution

See the file INSTALL for instructions on how to build and install
PostgreSQL.  That file also lists supported operating systems and
hardware platforms and contains information regarding any other
software packages that are required to build or run the PostgreSQL
system.  Changes between all PostgreSQL releases are recorded in the
file HISTORY.  Copyright and license information can be found in the
file COPYRIGHT.  A comprehensive documentation set is included in this
distribution; it can be read as described in the installation
instructions.

The latest version of this software may be obtained at
http://www.postgresql.org/download/.  For more information look at our
web site located at http://www.postgresql.org/.