Earlier quoted context omitted.
On the second page of the article: >Program the system to take the same amount of time to return both correct and incorrect passwords. This can be done in about six lines of code, Lawson said.
Only by introducing a delay where is none is needed. This makes things slower for the rest of us. 1 extra millisecond per user * 8 billion users * times 10 logins a day == Lots Of Lost Man Hours, probably enough to rebuild the great pyramids of Egypt by hand every year. Security researchers are the reason we can't have nice things. :)
Password crack [affecting OAuth and OpenID] could affect millions
31–40 of 61 posts
Re: Password crack [affecting OAuth and OpenID] could affect millions
#32Does anyone know how feasible this kind of attack is with real world network latency and server load fluctuations? In the end it comes down to statistics, but i could imagine forging a token this way might take a very high number of failed attempts, which might then trigger other security mechanisms?
From my understanding, actually surprisingly so. Stats allow you to cope with latency and uncertainty - just ask the NTP gurus. There's a reference somewhere, but effectively these attacks are possible over surprisingly long distances/dodgy connections.
Re: Password crack [affecting OAuth and OpenID] could affect millions
#33Why should this affect OAuth? The authentication mechanism is not part of the protocol. OpenID is for authentication and OAuth for authorization.
Checking out the code, it looks like the string comparison at the end of the check_message_signature method will leak timing info (uses rb_str_cmp internally?).
Link: http://github.com/openid/ruby-openid/blob/master/lib/openid/...
Edit: Was wrong about what could leak.
Re: Password crack [affecting OAuth and OpenID] could affect millions
#34if timing is so critical to these attacks, it seems adding a tiny variable (on the order of a millisecond) in response times would completely prevent this
http://rdist.root.org/2010/01/07/timing-independent-array-co...
Re: Password crack [affecting OAuth and OpenID] could affect millions
#35"On some login systems, the computer will check password characters one at a time, and kick back a "login failed" message as soon as it spots a bad character in the password. This means a computer returns a completely bad login attempt a tiny bit faster than a login where the first character in the password is correct." This doesn't sound right to me. Aren't passwords usually checked by hashing the entire password an…
Yes, systems that hash passwords aren't timeable, because attackers can't "propose" a hash that is correct to the first N bytes in order to find byte N + 1. If you are comparing literal passwords, you may have something more to be concerned about.
Python:
def is_equal(a, b):
if len(a) != len(b):
return False
result = 0
for x, y in zip(a, b):
result |= x ^ y
return result == 0
Java: public static boolean isEqual(byte[] a, byte[] b) {
if (a.length != b.length) {
return false;
}
int result = 0;
for (int i = 0; i
Code from http://codahale.com/a-lesson-in-timing-attacks/Re: Password crack [affecting OAuth and OpenID] could affect millions
#36Earlier quoted context omitted.
Only by introducing a delay where is none is needed. This makes things slower for the rest of us. 1 extra millisecond per user * 8 billion users * times 10 logins a day == Lots Of Lost Man Hours, probably enough to rebuild the great pyramids of Egypt by hand every year. Security researchers are the reason we can't have nice things. :)
The funniest part about these discussions is that we're discussing an optimization that exclusively helps attackers . Virtually all HMAC candidate hashes are correct all the way through the final byte, meaning that even in a classic short-circuited compare, you still have to read everything. In virtually all traffic, you never get to take that short circuit. The only time short-circuited comparisons ever make things…
Re: Password crack [affecting OAuth and OpenID] could affect millions
#37Does anyone know how feasible this kind of attack is with real world network latency and server load fluctuations? In the end it comes down to statistics, but i could imagine forging a token this way might take a very high number of failed attempts, which might then trigger other security mechanisms?
http://www.cs.rice.edu/~dwallach/pub/crosby-timing2009.pdf
Inside Amazon datacenters you also have lan-like performance.
Re: Password crack [affecting OAuth and OpenID] could affect millions
#38This timing attack is really old news, but subtle enough to persist in many a project, e.g. Rails patched it in v2.3.4 Sept 09 (briefly re-introduced it this month on edge). Will be interesting to see which of the big players were shown to be vulnerable.
This is an extremely dangerous attitude towards a vulnerability class . Rails did not fix the timing comparison of an OpenID HMAC verification; they fixed a timing bug in the HMAC comparison function of the Rails message verifier, which is used by session cookies and cannot be used for OpenID. This misconception is dangerous because old vulnerability classes are extremely pernicious and have a terrible habit of reapp…
Where'd that come from? That's a very interesting example to pull out of your hat.
Re: Password crack [affecting OAuth and OpenID] could affect millions
#39Everyone who reads HN is smart enough to simply read the primary source for this: http://lists.openid.net/pipermail/openid-security/2010-July/... Follow the thread. Nate is Root Labs, Taylor works for him. This is the same vulnerability as Nate found in Google Keyczar last year, and that Coda Hale found in Rails several months ago. Until people start handling crypto flaws the same way we handle buffer overflows, swee…
Re: Password crack [affecting OAuth and OpenID] could affect millions
#40It's amusing that timing attacks work essentially like those often-mocked Hollywood movies where the computer/hacker cracks the password one character at a time.