News for hackers. Stuff that matters.
Re:Okta – Username Above 52 Characters Security Advisory by magicalhippo on Friday November 01, 2024 @09:27PM (#42023327)
Potentially ignorant question, why would they go for bcrypt over say HKDF[1], especially since they mix in public data like the username and potentially userid?

[1]: https://datatracker.ietf.org/doc/html/rfc5869

Re:Okta – Username Above 52 Characters Security Advisory by ronsor on Friday November 01, 2024 @09:35PM (#42023360)
Why do we need a KDF for a cache key? Won't a normal cryptographic hash function (or its HMAC variant) suffice?
Re:Okta – Username Above 52 Characters Security Advisory by fanf2 on Friday November 01, 2024 @09:42PM (#42023393)
If the cache gets leaked, you don’t want any miscreants to be able to bruteforce passwords from the cache keys.
Re:Okta – Username Above 52 Characters Security Advisory by ronsor on Friday November 01, 2024 @09:59PM (#42023490)
Do we need to put the password in the cache key?
Re:Okta – Username Above 52 Characters Security Advisory by ptcrash on Saturday November 02, 2024 @12:14AM (#42024027)
If you want to validate a username/password authn attempt against a cache, then yes the username and password have to be someone in the mix.
Re:Okta – Username Above 52 Characters Security Advisory by magicalhippo on Friday November 01, 2024 @10:20PM (#42023593)
If the user changes password it invalidates the cache entries automatically, so you avoid stale credentials exploiting the cache

At least that's my immediate thought, could be wrong.

Re:Okta – Username Above 52 Characters Security Advisory by sebastialonso on Saturday November 02, 2024 @02:08AM (#42024362)
Can't believe the answers you're getting. The answer's a big fat NO. If you find yourself in that situation, there's something very incorrect with your design.
Re:Okta – Username Above 52 Characters Security Advisory by magicalhippo on Saturday November 02, 2024 @06:43AM (#42025458)
So how would you design it instead?
Re:Okta – Username Above 52 Characters Security Advisory by its-summertime on Saturday November 02, 2024 @02:29PM (#42028196)

    key = anyhash(uuid+username)
    if (result := cache.get(uuid+username)):
        if hash_and_equality(password, result.password_hash):
            return result.the_other_stuff
    # try login or else fail
Re:Okta – Username Above 52 Characters Security Advisory by magicalhippo on Saturday November 02, 2024 @02:50PM (#42028333)
Some insight into why this is good and why including the password as input in the derivation of the cache key is terrible would be appreciated.
Re:Okta – Username Above 52 Characters Security Advisory by its-summertime on Saturday November 02, 2024 @03:11PM (#42028475)
With no password in key: mildly cleaner to drop entries on password change, even if the cache didn't get the command to drop the key, the next login would override the old key's value anyhow, instead of potentially a key per password that was valid in the short period around a password change

Of course, if you have any validness of old sessions / passwords around a password change, you are doing something wrong.

My personal wondering is, considering KDF is meant to be expensive, why is IO more expensive to the point it needs a cache?

Re:Okta – Username Above 52 Characters Security Advisory by magicalhippo on Saturday November 02, 2024 @03:29PM (#42028625)
Thanks, good points.

> why is IO more expensive to the point it needs a cache

The advisory mentions it's only exploitable if the upstream auth server is unresponsive. So it seems to be mainly for resilience.

Re:Okta – Username Above 52 Characters Security Advisory by paulddraper on Saturday November 02, 2024 @09:48AM (#42026374)
Isn't the whole point of using bcrypt is that you can't bruteforce the password?