]> granicus.if.org Git - postgresql/commit
Secure Unix-domain sockets of "make check" temporary clusters.
authorNoah Misch <noah@leadboat.com>
Sat, 14 Jun 2014 13:41:13 +0000 (09:41 -0400)
committerNoah Misch <noah@leadboat.com>
Sat, 14 Jun 2014 13:41:17 +0000 (09:41 -0400)
commit453a5d91d49e4d35054f92785d830df4067e10c1
treee3cd078a0906d24406d22a18a3c2811fd756664b
parenta919937f112eb2f548d5f9bd1b3a7298375e6380
Secure Unix-domain sockets of "make check" temporary clusters.

Any OS user able to access the socket can connect as the bootstrap
superuser and proceed to execute arbitrary code as the OS user running
the test.  Protect against that by placing the socket in a temporary,
mode-0700 subdirectory of /tmp.  The pg_regress-based test suites and
the pg_upgrade test suite were vulnerable; the $(prove_check)-based test
suites were already secure.  Back-patch to 8.4 (all supported versions).
The hazard remains wherever the temporary cluster accepts TCP
connections, notably on Windows.

As a convenient side effect, this lets testing proceed smoothly in
builds that override DEFAULT_PGSOCKET_DIR.  Popular non-default values
like /var/run/postgresql are often unwritable to the build user.

Security: CVE-2014-0067
contrib/pg_upgrade/test.sh
doc/src/sgml/regress.sgml
src/test/regress/.gitignore
src/test/regress/GNUmakefile
src/test/regress/pg_regress.c