In postgresql 9.3.x before 9.3.21, 9.4.x before 9.4.16, 9.5.x before 9.5.11, 9.6.x before 9.6.7 and 10.x before 10.2, pg_upgrade creates file in current working directory containing the output of `pg_dumpall -g` under umask which was in effect when the user invoked pg_upgrade, and not under 0077 which is normally used for other temporary files. This can allow an authenticated attacker to read or modify the one file, which may contain encrypted or unencrypted database passwords. The attack is infeasible if a directory mode blocks the attacker searching the current working directory or if the prevailing umask blocks the attacker opening the file.
https://www.postgresql.org/about/news/1829/
https://usn.ubuntu.com/3564-1/
https://lists.debian.org/debian-lts-announce/2018/02/msg00006.html
https://access.redhat.com/errata/RHSA-2018:3816
https://access.redhat.com/errata/RHSA-2018:2566