Live data from Hacker News

Okta – Username Above 52 Characters Security Advisory

trust.okta.com

21–30 of 78 posts

Re: Okta – Username Above 52 Characters Security Advisory

#21
post #3

I'm really sick of companies disclosing this shit late Friday afternoon. Go fuck yourselves. Sincerely, Everyone in the industry

Also, are there any repercussions for this kind of stuff? I don't know, fines from the organizations they get compliance certifications from or something.

Re: Okta – Username Above 52 Characters Security Advisory

#22
post #7

Earlier quoted context omitted.

I mean yes overall, but why would put delimeters into hash? you just smash bytes together.

Username: x@example.xyz Password: .com/!@#$% Concatenated: x@example.xyz.com/!@#$% Username: x@example.xyz.com Password: /!@#$% Concatenated: x@example.xyz.com/!@#$%

A delimiter fixes the problem if you're sure the delimiter character can never be inside the username and password. Better would be to prefix the length of each field. Better still would be separately hashing each field and concatenating the results.

Re: Okta – Username Above 52 Characters Security Advisory

#23
post #7

Earlier quoted context omitted.

I mean yes overall, but why would put delimeters into hash? you just smash bytes together.

Username: x@example.xyz Password: .com/!@#$% Concatenated: x@example.xyz.com/!@#$% Username: x@example.xyz.com Password: /!@#$% Concatenated: x@example.xyz.com/!@#$%

[deleted]

Re: Okta – Username Above 52 Characters Security Advisory

#25
post #20
post #5

> https://man.openbsd.org/crypt > So if the userid is 18 digits, the username is 52 characters, and the delimiters are 1 character each, then the total length of the non-secret prefix is 72, and bcrypt will drop the secret suffix. You aren’t supposed to put more than the salt and the password into trad unix password hashes.

why would someone in 2024 reach for bcrypt for building a secure hash key?

okta has been around longer than a year and momentum keeps a lot of companies from changing anything until catastrophe strikes

Re: Okta – Username Above 52 Characters Security Advisory

#26
post #5

> https://man.openbsd.org/crypt > So if the userid is 18 digits, the username is 52 characters, and the delimiters are 1 character each, then the total length of the non-secret prefix is 72, and bcrypt will drop the secret suffix. You aren’t supposed to put more than the salt and the password into trad unix password hashes.

Here's how I see it:

Core issue (okta's approach):

  * They concatenated userId + username + password for a cache key
  * Used BCrypt (which has a 72-byte limit)
  * The concatenation could exceed 72 bytes, causing the password portion to be truncated
Why this is problematic:

  * BCrypt is designed for password hashing, not cache key generation
  * Mixing identifiers (userId, username) with secrets (password) in the same hash
  * Truncation risk due to BCrypt's limits
Password storage should be separate from cache key generation. Use a random salt + appropriate hash function and for cache keys - use HMAC or KDF w/appropriate inputs

Re: Okta – Username Above 52 Characters Security Advisory

#28

Earlier quoted context omitted.

Username: x@example.xyz Password: .com/!@#$% Concatenated: x@example.xyz.com/!@#$% Username: x@example.xyz.com Password: /!@#$% Concatenated: x@example.xyz.com/!@#$%

A delimiter fixes the problem if you're sure the delimiter character can never be inside the username and password. Better would be to prefix the length of each field. Better still would be separately hashing each field and concatenating the results.

I tend to use '\0' as a delimiter for this reason.

Re: Okta – Username Above 52 Characters Security Advisory

#29
post #14
post #12

Earlier quoted context omitted.

If the cache gets leaked, you don’t want any miscreants to be able to bruteforce passwords from the cache keys.

Do we need to put the password in the cache key?

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

#30
post #2

Concise write up; not surprising that cache played a part. Can't tell if it's issue with BCrypt or with the state-data going into the key, or combo-cache lookup tho.

I think it's more of a logic problem. I suspect the engineers made a false assumption that bcrypt can hash a trivial amount of data like some other hashing algos.
Post reply on HN