pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Re-validate connection string in libpqrcv_connect().
Date: Fri, 12 Jan 2024 21:43:12 +0000
Message-ID: <E1rOPJ2-00184d-Md@gemulon.postgresql.org> (raw)

Re-validate connection string in libpqrcv_connect().

A superuser may create a subscription with password_required=true, but
which uses a connection string without a password.

Previously, if the owner of such a subscription was changed to a
non-superuser, the non-superuser was able to utilize a password from
another source (like a password file or the PGPASSWORD environment
variable), which should not have been allowed.

This commit adds a step to re-validate the connection string before
connecting.

Reported-by: Jeff Davis
Author: Vignesh C
Reviewed-by: Peter Smith, Robert Haas, Amit Kapila
Discussion: https://www.postgresql.org/message-id/flat/e5892973ae2a80a1a3e0266806640dae3c428100.camel%40j-davis....
Backpatch-through: 16

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4c03ac7e2bc46988fe4ecf3b1aef393488786f12

Modified Files
--------------
doc/src/sgml/ref/create_subscription.sgml          | 11 +--
.../libpqwalreceiver/libpqwalreceiver.c            |  9 +++
src/test/subscription/t/027_nosuperuser.pl         | 80 ++++++++++++++++++++++
3 files changed, 95 insertions(+), 5 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1rOPJ2-00184d-Md@gemulon.postgresql.org>
Permalink:  ../E1rOPJ2-00184d-Md@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rOPJ2-00184d-Md@gemulon.postgresql.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: jdavis@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Re-validate connection string in libpqrcv_connect().
  In-Reply-To: <E1rOPJ2-00184d-Md@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