Re: Modern SHA2- based password hashes for pgcrypto - Mailing list pgsql-hackers

From Japin Li
Subject Re: Modern SHA2- based password hashes for pgcrypto
Date
Msg-id ME0P300MB0445AB105D934CBB1F859D57B6EC2@ME0P300MB0445.AUSP300.PROD.OUTLOOK.COM
Whole thread Raw
List pgsql-hackers
On Fri, 24 Jan 2025 at 19:06, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> On 2025-Jan-24, Bernd Helmle wrote:
>
>> So we behave exactly the same way as px_crypt_md5(): It stops after the
>> first '$' after the magic byte preamble. For shacrypt, this could be
>> the next '$' after the closing one of the non-mandatory 'rounds'
>> option, but with your example this doesn't happen since it gets never
>> parsed. The salt length will be set to 0.
>
> IMO silently using no salt or 0 iterations because the input is somewhat
> broken is bad security and should be rejected.  If we did so in the past
> without noticing, that's bad already, but we should not replicate that
> behavior any further.
>

I agree with this point, so maybe we should fix this for px_crypt_md().

-- 
Regrads,
Japin Li



pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: speedup COPY TO for partitioned table.
Next
From: Umar Hayat
Date:
Subject: Re: New process of getting changes into the commitfest app