News for hackers. Stuff that matters.
Re:Okta – Username Above 52 Characters Security Advisory by Dylan16807 on Friday November 01, 2024 @10:57PM (#42023734)
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 by akira2501 on Saturday November 02, 2024 @12:05AM (#42023990)
I tend to use '\0' as a delimiter for this reason.
Re:Okta – Username Above 52 Characters Security Advisory by Dylan16807 on Saturday November 02, 2024 @12:26AM (#42024063)
You still need to make sure nulls can't show up, and you need to consider possible truncation scenarios caused by those nulls and make sure they won't cause silent failures at any point.
Re:Okta – Username Above 52 Characters Security Advisory by akira2501 on Saturday November 02, 2024 @01:06AM (#42024178)
> You still need to make sure nulls can't show up

Which is very easy to do without losing any desired functionality as opposed to delimiters in the ASCII character range.

> and you need to consider possible truncation scenarios

In particular hashing libraries worth using never have this problem.

> and make sure they won't cause silent failures at any point.

They literally only need to exist in the data to one function call. Afterwards they are not needed or significant.

Re:Okta – Username Above 52 Characters Security Advisory by brianshaler on Saturday November 02, 2024 @10:12AM (#42026505)
Re the second quote and response:

One pattern I bump up against from time to time is the delta between using a perfectly defensible technique for a given use-case (safe delimiters when constructing an input for a specific function) versus a desire to have each decision be driven by some universal law (e.g. "if you're streaming data between services, using null bytes as delimiters might not be safe if consuming services may truncate at null bytes, so NEVER use null bytes as delimiters because they can be unsafe")

It's not even a matter of one "side" being right or wrong. You can simultaneously be right that this is perfectly safe in this use-case, while someone else can be right to be concerned ("need to consider possible") because the code will forever be one refactor or copy/paste away from this concatenated string being re-used somewhere else.

Re:Okta – Username Above 52 Characters Security Advisory by Dylan16807 on Saturday November 02, 2024 @01:27PM (#42027756)
> In particular hashing libraries worth using never have this problem.

I'll note that the reason we're here in the first place is that they were using a password hash library with a completely unacceptable API.

Re:Okta – Username Above 52 Characters Security Advisory by jrockway on Saturday November 02, 2024 @04:16AM (#42024858)
Personally, I like a fixed uint8 or uint16 representing the length of each segment. Then, there are no forbidden characters or quoting required. Maybe I want to have \0 in my password.