From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Ensure that all temp files made during pg_upgrade are non-world-
Date: Mon, 05 Feb 2018 15:58:54 +0000
Message-ID: <E1eijAU-0006Qn-PF@gemulon.postgresql.org> (raw)
Ensure that all temp files made during pg_upgrade are non-world-readable.
pg_upgrade has always attempted to ensure that the transient dump files
it creates are inaccessible except to the owner. However, refactoring
in commit 76a7650c4 broke that for the file containing "pg_dumpall -g"
output; since then, that file was protected according to the process's
default umask. Since that file may contain role passwords (hopefully
encrypted, but passwords nonetheless), this is a particularly unfortunate
oversight. Prudent users of pg_upgrade on multiuser systems would
probably run it under a umask tight enough that the issue is moot, but
perhaps some users are depending only on pg_upgrade's umask changes to
protect their data.
To fix this in a future-proof way, let's just tighten the umask at
process start. There are no files pg_upgrade needs to write at a
weaker security level; and if there were, transiently relaxing the
umask around where they're created would be a safer approach.
Report and patch by Tom Lane; the idea for the fix is due to Noah Misch.
Back-patch to all supported branches.
Security: CVE-2018-1053
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a926eb84e07a604da6d059eca1fd87f919bb5d7a
Modified Files
--------------
src/bin/pg_upgrade/dump.c | 10 ----------
src/bin/pg_upgrade/file.c | 15 ---------------
src/bin/pg_upgrade/pg_upgrade.c | 4 ++++
src/bin/pg_upgrade/pg_upgrade.h | 4 +++-
4 files changed, 7 insertions(+), 26 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Ensure that all temp files made during pg_upgrade are non-world-
In-Reply-To: <E1eijAU-0006Qn-PF@gemulon.postgresql.org>
References: <E1eijAU-0006Qn-PF@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox