Re: Possible to store invalid SCRAM-SHA-256 Passwords

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, Stephen Frost <sfrost(at)snowman(dot)net>
Subject: Re: Possible to store invalid SCRAM-SHA-256 Passwords
Date: 2019-04-22 01:50:51
Message-ID: 20190422015051.GA3433@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Apr 20, 2019 at 04:12:56PM -0400, Jonathan S. Katz wrote:
> I modified the "get_password_type" function to perform a SCRAM
> verification to see if it is a properly hashed SCRAM password. If it is,
> we treat the password as a SCRAM hashed one. Otherwise, we proceed to
> the next step, which is to treat it as a plainly stored one.

Since v10, we don't allow the storage of plain verifiers so if a
string does not match what we think is a correct SCRAM or MD5
verifier, then it should be processed according to
password_encryption when storing the verifier or processed according
to the auth protocol with the HBA entry matching. Your patch looks
fine to me, I would have just added a test case in password.sql (no
need to send a new patch I can take care of it).

Any objections to back-patch that stuff to v10?
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jonathan S. Katz 2019-04-22 13:04:43 Re: Possible to store invalid SCRAM-SHA-256 Passwords
Previous Message Tom Lane 2019-04-21 19:46:18 Re: Segfault behaviour