pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: postgres-bug@gms.tf
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15930: Redact PGPASSWORD environment variable in psql
Date: Sat, 27 Jul 2019 11:23:29 -0400
Message-ID: <20360.1564241009@sss.pgh.pa.us> (raw)
In-Reply-To: <15930-1a5562cad4a72900@postgresql.org>
References: <15930-1a5562cad4a72900@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> Under Linux, when supplying the password via PGPASSWORD to the psql command
> the password can be easily retrieved from the /proc/$pid/environ pseudo file
> (or indirectly with e.g. `ps ae`) - for the complete runtime of the psql
> process.

This is true on many OSes.  Generally speaking, we deprecate use of
PGPASSWORD at all on such platforms.  Having psql try to clear it out
seems rather pointless to me, as (a) that does nothing for instances
of the value that appear in the environments of ancestor processes,
and (b) I doubt there is any platform-independent way to hide it.

FWIW, Postgres offers a number of other authentication mechanisms
that can be both more secure and more convenient than passwords.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <20360.1564241009@sss.pgh.pa.us>
Permalink:  ../20360.1564241009@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20360.1564241009@sss.pgh.pa.us

 · 

reply

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, postgres-bug@gms.tf
  Subject: Re: BUG #15930: Redact PGPASSWORD environment variable in psql
  In-Reply-To: <20360.1564241009@sss.pgh.pa.us>
  References: <15930-1a5562cad4a72900@postgresql.org> <20360.1564241009@sss.pgh.pa.us>

* 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