From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: postgres_fdw: improve security checks |
Date: | 2025-03-24 15:01:37 |
Message-ID: | E1twjJ2-000nDA-2U@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
postgres_fdw: improve security checks
SCRAM pass-through should not bypass the FDW security check as it was
implemented for postgres_fdw in commit 761c79508e7.
This commit improves the security check by adding new SCRAM
pass-through checks to ensure that the required SCRAM connection
options are not overwritten by the user mapping or foreign server
options. This is meant to match the security requirements for a
password-using connection.
Since libpq has no SCRAM-specific equivalent of
PQconnectionUsedPassword(), we enforce this instead by making the
use_scram_passthrough option of postgres_fdw imply
require_auth=scram-sha-256. This means that if use_scram_passthrough
is set, some situations that might otherwise have worked are
preempted, for example GSSAPI with delegated credentials. This could
be enhanced in the future if there is desire for more flexibility.
Reported-by: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Author: Matheus Alcantara <mths(dot)dev(at)pm(dot)me>
Co-authored-by: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Reviewed-by: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/CAFY6G8ercA1KES%3DE_0__R9QCTR805TTyYr1No8qF8ZxmMg8z2Q%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/76563f88cfbd91696e7ebe568dead648f2d229ff
Modified Files
--------------
contrib/postgres_fdw/connection.c | 102 ++++++++++++++++++++++++++-----
contrib/postgres_fdw/t/001_auth_scram.pl | 41 +++++++++++++
doc/src/sgml/postgres-fdw.sgml | 11 +---
3 files changed, 132 insertions(+), 22 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Fujii Masao | 2025-03-24 15:17:44 | pgsql: doc: Clarify required options for each action in pg_recvlogical. |
Previous Message | Magnus Hagander | 2025-03-24 13:43:31 | pgsql: psql: show default extension version in \dx output |