News for hackers. Stuff that matters.
Re:Steam hit by major security breach by pja on Monday July 27, 2015 @03:29AM (#9953867)
Yeah, strcmp() exists for a reason!
Re:Steam hit by major security breach by akx on Monday July 27, 2015 @03:58AM (#9953942)
But in this case you'd want to use a constant-time string comparison function, which, afaik, strcmp() is not.
Re:Steam hit by major security breach by simias on Monday July 27, 2015 @04:12AM (#9953980)
Is such a timing attack really possible over the internet? I'd expect the code to expire after a few failed attempt anyway.

But I guess you're right, better safe than sorry.

Re:Steam hit by major security breach by brobinson on Monday July 27, 2015 @04:36AM (#9954045)
Surprisingly... yes, it is possible. See the link in my other comment: https://news.ycombinator.com/item?id=9953496
Re:Steam hit by major security breach by pja on Monday July 27, 2015 @05:49AM (#9954249)
Good point. Is there are library of constant time functions for security sensitive applications to replace the standard ones in libc? (Seems like the kind of thing that the OpenBSD people might have written.)

strcmp() is at least better than a buggy equivalent that doesn’t actually work :)

Re:Steam hit by major security breach by SCHiM on Monday July 27, 2015 @07:33AM (#9954534)
The idea is to use constant time hashing functions, and then compare the hashes instead of comparing the strings themselves. AFAIK there is no implementation of the C stdlib that makes sure no timing attacks can be performed.
Re:Steam hit by major security breach by rplnt on Monday July 27, 2015 @05:09AM (#9954139)
We're comparing one-time fixed-length code. Is it necessary?
Re:Steam hit by major security breach by mikeash on Monday July 27, 2015 @11:47AM (#9955850)
Probably not. Ideally you'd implement this endpoint to invalidate the code after a few failures, so a timing attack would be impossible to carry out. But it's a good idea to use one anyway, in case it turns out that you're wrong, or that other code is also broken somehow. It costs almost nothing to do so.