Re: Possible to store invalid SCRAM-SHA-256 Passwords
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: "Jonathan S. Katz" <jkatz@postgresql.org>
Cc: pgsql-bugs@lists.postgresql.org, Stephen Frost <sfrost@snowman.net>
Date: 2019-04-22T01:50:51Z
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
Commits
-
Fix detection of passwords hashed with MD5
- a82c06f4001d 9.4.22 landed
- 20dbc84bd002 9.5.17 landed
- af298f00a1e8 9.6.13 landed
-
Fix detection of passwords hashed with MD5 or SCRAM-SHA-256
- 15fe91e70ec6 10.8 landed
- 7f56d43663dd 11.3 landed
- ccae190b916f 12.0 landed