Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

auth-scram.c

Blame
    • Michael Paquier's avatar
      ccae190b
      Fix detection of passwords hashed with MD5 or SCRAM-SHA-256 · ccae190b
      Michael Paquier authored
      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
      ccae190b
      History
      Fix detection of passwords hashed with MD5 or SCRAM-SHA-256
      Michael Paquier authored
      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