Re: Require SSL connection to postgres for oauth

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Require SSL connection to postgres for oauth
Date: 2026-06-18 04:54:59
Message-ID: CAN4CZFNy23wWKF+78QG3cfunjJpQWFc7eNP7qcYPB6Sg-NhTQQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> It absolutely *does* have that requirement! If you need connection
> security, do NOT use SCRAM without authenticated transport encryption.
> Untrusted connection without TLS isn't part of the supported security
> model, which is why strengthening SCRAM for those use cases is
> discussed in public [1] rather than under a CVE fix.

I was referring to the rfc, as SCRAM explicitly allows non-TLS
connections, it just recommends using it.
Oauthbearer explicitly requires it.

So allowing users to use scram on plaintext without warnings looks
acceptable to me, but it's questionable for oauth.

> But the communication with the server uses the Postgres model of
> security, which unfortunately puts more requirements on end users.
> ...
> Since it was an explicit decision rather than an oversight, I think
> you'd have a hard time overcoming the backport barrier without a
> really strong consensus.

I added another patch which is only a documentation improvement,
that's the new 0001. The documentation is very clear about "password"
being insecure over plaintext connections, but there's no such mention
for oauth. This aims to fix that at all places where oauth is
mentioned. This, or this together with the server side warning should
be an improvement for all versions, even without the client side
change.

0002 and 0003 are the previous patches unchanged.

> so I'd like to strengthen
> that for everybody who uses the server and not just OAuth users.

What do you think about adding a similar server-side warning/info
message for plaintext+password and ident too in 0003?

Attachment Content-Type Size
v3-0001-doc-warn-that-OAuth-over-plaintext-connections-is.patch application/octet-stream 3.0 KB
v3-0002-libpq-require-encrypted-connections-for-OAUTHBEAR.patch application/octet-stream 7.8 KB
v3-0003-Warn-when-OAuth-is-configured-on-plaintext-capabl.patch application/octet-stream 3.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2026-06-18 05:18:47 Re: Fix tuple deformation with virtual generated NOT NULL columns
Previous Message Thomas Munro 2026-06-18 04:50:42 Re: ci: CCache churns through available space too quickly