Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZPhSV-0000Ct-49 for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Aug 2015 01:37:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZPhSU-0001zq-Eo for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Aug 2015 01:37:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZPhRC-0000BE-Vm for pgsql-hackers@postgresql.org; Thu, 13 Aug 2015 01:36:11 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZPhRA-0000sz-5U for pgsql-hackers@postgresql.org; Thu, 13 Aug 2015 01:36:10 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 55D6D5F7A0; Wed, 12 Aug 2015 21:36:07 -0400 (EDT) Date: Wed, 12 Aug 2015 21:36:07 -0400 From: Stephen Frost To: Robert Haas Cc: Peter Eisentraut , Josh Berkus , Heikki Linnakangas , Michael Paquier , pgsql-hackers Subject: Re: WIP: SCRAM authentication Message-ID: <20150813013607.GS3685@tamriel.snowman.net> References: <55CA4085.30101@gmx.net> <55CB5D38.5090503@gmx.net> <55CBA425.5070803@gmx.net> <20150812200938.GM3685@tamriel.snowman.net> <20150812203732.GN3685@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="nm6xw7ZBz6omhtYt" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-61-generic (x86_64) X-Uptime: 21:25:35 up 8 days, 9:56, 4 users, load average: 0.18, 0.19, 0.16 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --nm6xw7ZBz6omhtYt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Robert, * Robert Haas (robertmhaas@gmail.com) wrote: > On Wed, Aug 12, 2015 at 4:37 PM, Stephen Frost wrote: > >> Please don't conflate those two things. They are radically different > >> in terms of the amount of upgrade pain that they cause. The first one > >> would be completely insane. > > > > Thanks for the clarification. I had gotten the (apparently mistaken) > > impression[1] that there was some consideration for a hard break from > > one release to the next to move from md5 to SCRAM. >=20 > Gosh, no way. Sorry if I gave the contrary impression; that was > certainly not my intention. As I said before, I have no reason to > believe that MD5 is insecure in the way we are using it. Unless much > better attacks are published, I don't really care if people are still > using it 5 years from now, or even 10. I just want to give people an > *option* to move away from it, because: No worries, thanks again for the clarification and my apologies for misunderstanding and jumping to an incorrect assumption. As for the question about MD5, I do feel that we're using it in about the best way possible, but I don't feel it's a terribly secure algorithm today. I'd really like to see people moving away from it sooner rather than later and that our defaults move to much more secure solutions. > (1) It's possible that better attacks may be published, and > (2) Even if they aren't, some people don't want to use anything that > says "MD5" on the tin. >=20 > > Would be great to get comments on the other comments, specifically that > > adding SCRAM's password verifier won't seriously change the security of > > a user's account or password based on an attack vector where the > > contents of pg_authid is compromised. I do agree with the general > > concern that the additional complexity involved in supporting multiple > > password verifiers may result in bugs, and likely security ones, but I > > really expect the larger risk to be from the SCRAM implementation itself > > than how we get data into and back out of our own catalogs. >=20 > Yes, the SCRAM implementation could be buggy. But also, OpenSSL has > repeatedly had security bugs that were due to forcing servers to > downgrade to older protocols. I wouldn't like us to start growing > similar vulnerabilities, where SCRAM would have been just fine but an > attack that involves forcing a downgrade to MD5 is possible. I agree that such similar vulnerabilities would be unfortunate, but the way to avoid that is to not implement the actual hashing or encryption algorithms ourselves and to stick to the protocol as defined in the specification. > I don't think you are quite correct about the scenario where pg_authid > is compromised. Even if the hash stored there is functionally > equivalent to the password itself as far as this instance of > PostgreSQL is concerned, the same password may have been used for > other services, so cracking it has a purpose. I attempted to address that also by stating that, should an attacker compromise a system with the goal of gaining the cleartext password, they would attempt the following, in order: 1) attempt to compromise a superuser account, if not already done, and then modify the system to get the 'password' auth mechanism to be used whereby the password is sent in the clear 2) change the existing password, or encourge the user to do so and somehow capture that activity 3) social engineering attacks 4) attempt to crack the md5 hash 5) attempt to crack the SCRAM password verifier 6) try to work out a way to use both the md5 hash and the SCRAM password verifier to figure out the password In terms of difficulty, while I believe the above is the right overall ordering, the level of difficulty goes up seriously between 4 and 5, with 6 requiring a level of expertise in hash algorithms and SCRAM that I have a very hard time seeing anyone bothering to go there, rather than just throw more CPUs at the md5 hash. Thanks! Stephen --nm6xw7ZBz6omhtYt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJVy/SGAAoJEO1sijiDR2RVkD8P/06SaE0VLNLMP9uj3Hs/+chv e4SOxsSHqgTRX17vDYQmqbGHhJp1fDZJ/SvGK6fKLf91wOgwH1XzUR7qavv81zqO NomVh4XiEudM6uXgpaPxWG5jJv0DFac3wSPuUds+DZZ+IqWehNG+7gxV6clTeTX9 kx7CC43T4yh1SlN07MYULOlNEK8jEQ8wkwNMX5inYgNUJxwbLtENew1IsSfW9jwS z0cyELuyaBjU1qyelWJQ4FHoebzcQgR2stP7fQW+cLIJyR3hwYKlBt4V9O6hJdkI ZbY0WpnqQd8iBe8F/qoVBRnMtJTocqNiA9szKZmpQ0wuI5eEg2PCFPymj+ujAXyO x6tF4Om4JzfSBZxkQciHd/xkBdplq+6IEKOqAgsMEsVReoVyomZ9S9lacyIXcNGd 9MSRJFzKSXZ706Pv+MJ7FhKxqfwyYnPSMpd6/aH9QDP+pKMOwL0as2n9aKxLNxni fFlm7eIW/6wV+CTsreoMeALHDo+/Gb1jwLs8OkgIo6F2aAGFM/vB8Z8a50Hzx/iN bDpWHFJtfejazVOUKCDC9BEyW+WupQDwJ/Lm8JerocwihjMXHi3FUK4DXQEUu+Oc UbJ3UC0dn7hyLHs747J8MTNWoWxCJKkxDGdMBb1ihlFzK400FJ7R6yL47bRwTtTk bzLU16+eFfhGhtyB8ZnH =7cj/ -----END PGP SIGNATURE----- --nm6xw7ZBz6omhtYt--