pgsql: Use value of scram_iterations in mock_scram_secret(). - Mailing list pgsql-committers

From Noah Misch
Subject pgsql: Use value of scram_iterations in mock_scram_secret().
Date
Msg-id E1wtQFo-00000000y9L-3j7l@gemulon.postgresql.org
Whole thread
List pgsql-committers
Use value of scram_iterations in mock_scram_secret().

Presently, mock_scram_secret() always uses
SCRAM_SHA_256_DEFAULT_ITERATIONS, which poses an observable
response discrepancy hazard when scram_iterations is set to
something else.  To fix, use the value of the configuration
parameter instead, and document that unauthenticated users can
discover the existence of roles with passwords created with
different iteration counts.

Reported-by: Radim Marek <radim@boringsql.com>
Author: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Jacob Champion <champion.p@gmail.com>
Security: CVE-2026-14672
Backpatch-through: 16

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/822143c4d1dce62a43b98341eacbd4429eca7e59
Author: Nathan Bossart <nathan@postgresql.org>

Modified Files
--------------
doc/src/sgml/config.sgml       | 13 +++++++++++++
src/backend/libpq/auth-scram.c |  2 +-
2 files changed, 14 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Noah Misch
Date:
Subject: pgsql: Harden tsquery code against overflows.
Next
From: Noah Misch
Date:
Subject: pgsql: Avoid overflow in Levenshtein distance calculations.