git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: b5f58cf) | patch
Fix detection of passwords hashed with MD5 or SCRAM-SHA-256
2019年4月23日 06:43:21 +0000 (15:43 +0900)
2019年4月23日 06:43:21 +0000 (15:43 +0900)
commit ccae190b916f27fbe4079ee4664d34cd1be47b79
Fix detection of passwords hashed with MD5 or SCRAM-SHA-256

This commit fixes a couple of issues related to the way password
verifiers hashed with MD5 or SCRAM-SHA-256 are detected, leading to
being able to store in catalogs passwords which do not follow the
supported hash formats:
- A MD5-hashed entry was checked based on if its header uses "md5" and
if the string length matches what is expected. Unfortunately the code
never checked if the hash only used hexadecimal characters, as reported
by Tom Lane.
- A SCRAM-hashed entry was checked based on only its header, which
should be "SCRAM-SHA-256$", but it never checked for any fields
afterwards, as reported by Jonathan Katz.

Backpatch down to v10, which is where SCRAM has been introduced, and
where password verifiers in plain format have been removed.

Author: Jonathan Katz
Reviewed-by: Tom Lane, Michael Paquier
Discussion: https://postgr.es/m/016deb6b-1f0a-8e9f-1833-a8675b170aa9@postgresql.org
Backpatch-through: 10
src/backend/libpq/auth-scram.c diff | blob | blame | history
src/backend/libpq/crypt.c diff | blob | blame | history
src/include/common/md5.h diff | blob | blame | history
src/include/libpq/scram.h diff | blob | blame | history
src/test/regress/expected/password.out diff | blob | blame | history
src/test/regress/sql/password.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /