pgsql: Fix incorrect password transformation in contrib/pgcrypto's DES

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix incorrect password transformation in contrib/pgcrypto's DES
Date: 2012-05-30 14:54:54
Message-ID: E1SZkIY-0000s1-PR@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix incorrect password transformation in contrib/pgcrypto's DES crypt().

Overly tight coding caused the password transformation loop to stop
examining input once it had processed a byte equal to 0x80. Thus, if the
given password string contained such a byte (which is possible though not
highly likely in UTF8, and perhaps also in other non-ASCII encodings), all
subsequent characters would not contribute to the hash, making the password
much weaker than it appears on the surface.

This would only affect cases where applications used DES crypt() to encode
passwords before storing them in the database. If a weak password has been
created in this fashion, the hash will stop matching after this update has
been applied, so it will be easy to tell if any passwords were unexpectedly
weak. Changing to a different password would be a good idea in such a case.
(Since DES has been considered inadequately secure for some time, changing
to a different encryption algorithm can also be recommended.)

This code, and the bug, are shared with at least PHP, FreeBSD, and OpenBSD.
Since the other projects have already published their fixes, there is no
point in trying to keep this commit private.

This bug has been assigned CVE-2012-2143, and credit for its discovery goes
to Rubin Xu and Joseph Bonneau.

Branch
------
REL8_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/dd957a5bb90b05269f61db7bd3d9785afd5eb0e5

Modified Files
--------------
contrib/pgcrypto/crypt-des.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2012-05-30 16:17:04 Re: Re: [COMMITTERS] pgsql: Send new protocol keepalive messages to standby servers.
Previous Message Heikki Linnakangas 2012-05-30 09:06:11 pgsql: Delete the temporary file used in buffered GiST build, after the