postgresql/src/backend
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
..
access fsync backup_label after pg_start_backup() 2012-08-08 21:07:35 +01:00
bootstrap Avoid changing an index's indcheckxmin horizon during REINDEX. 2011-04-19 18:51:12 -04:00
catalog Fix bugs in information_schema.referential_constraints view. 2011-10-14 20:24:50 -04:00
commands Fix longstanding crash-safety bug with newly-created-or-reset sequences. 2012-07-25 17:41:04 -04:00
executor Fix whole-row Var evaluation to cope with resjunk columns (again). 2012-07-20 13:09:32 -04:00
lib Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
libpq Use OpenSSL's SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag. 2011-07-24 15:18:12 -04:00
main Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
nodes Fix copyfuncs/equalfuncs support for ReassignOwnedStmt. 2012-04-18 10:46:52 -04:00
optimizer Refactor pattern_fixed_prefix() to avoid dealing in incomplete patterns. 2012-07-09 23:23:28 -04:00
parser Prevent CREATE TABLE LIKE/INHERITS from (mis) copying whole-row Vars. 2012-06-30 16:44:19 -04:00
po Translation updates 2012-08-14 16:24:41 -04:00
port Fix Windows implementation of PGSemaphoreLock. 2012-05-10 13:36:33 -04:00
postmaster Fix syslogger so that log_truncate_on_rotation works in the first rotation. 2012-07-31 14:37:18 -04:00
regex Prevent corner-case core dump in rfree(). 2012-07-15 13:28:32 -04:00
rewrite Prevent CREATE TABLE LIKE/INHERITS from (mis) copying whole-row Vars. 2012-06-30 16:44:19 -04:00
snowball Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:12 +02:00
storage Only allow autovacuum to be auto-canceled by a directly blocked process. 2012-07-26 14:29:52 -04:00
tcop set_stack_base() no longer needs to be called in PostgresMain. 2012-04-08 19:42:13 +03:00
tsearch Fix bug in to_tsquery(). 2012-05-15 19:27:00 +03:00
utils 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
Makefile Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
nls.mk Install a more robust solution for the problem of infinite error-processing 2008-10-27 19:37:29 +00:00