pgsql: start-scripts: switch to $PGUSER before opening $PGLOG.

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: start-scripts: switch to $PGUSER before opening $PGLOG.
Date: 2017-11-06 15:12:49
Message-ID: E1eBj4z-0002Pu-39@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

start-scripts: switch to $PGUSER before opening $PGLOG.

By default, $PGUSER has permission to unlink $PGLOG. If $PGUSER
replaces $PGLOG with a symbolic link, the server will corrupt the
link-targeted file by appending log messages. Since these scripts open
$PGLOG as root, the attack works regardless of target file ownership.

"make install" does not install these scripts anywhere. Users having
manually installed them in the past should repeat that process to
acquire this fix. Most script users have $PGLOG writable to root only,
located in $PGDATA. Just before updating one of these scripts, such
users should rename $PGLOG to $PGLOG.old. The script will then recreate
$PGLOG with proper ownership.

Reviewed by Peter Eisentraut. Reported by Antoine Scemama.

Security: CVE-2017-12172

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b5002976804cfd42ada725b30cff324ebd3e9638

Modified Files
--------------
contrib/start-scripts/freebsd | 4 ++--
contrib/start-scripts/linux | 4 ++--
contrib/start-scripts/osx/PostgreSQL | 8 ++++----
3 files changed, 8 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-11-06 15:29:58 pgsql: Make json{b}_populate_recordset() use the right tuple descriptor
Previous Message Dean Rasheed 2017-11-06 09:24:03 pgsql: Always require SELECT permission for ON CONFLICT DO UPDATE.