OAuth, OpenID Password Crack Could Affect Millions
CWmike writes "Researchers Nate Lawson and Taylor Nelson say they've discovered a basic security flaw that affects dozens of open-source software libraries — including those used by software that implements the OAuth and OpenID standards — that are used to check passwords and user names when people log into websites such as Twitter and Digg. By trying to log in again and again, cycling through characters and measuring the time it takes for the computer to respond, hackers can ultimately figure out the correct passwords. This may all sound very theoretical, but timing attacks can actually succeed in the real world. Three years ago, one was used to hack Microsoft's Xbox 360 gaming system, and people who build smart cards have added timing attack protection for years. The researchers plan to discuss their attacks at the Black Hat conference later this month in Las Vegas."
n/t
Alexander Peter Kristopeit bought his basement from his mommy for one dollar.
Wait, doesn't slashdot use OpenID?
It's just a matter of time. Anyone seen Swordfish?
hope a preventative measure gets added soon, OpenID is a great idea, i really like only having one login, but still, tightening up the corners is important ^^
If you do almost any sort of reasonable hashing or encryption algorthm on a password, this becomes a moot point, since the place that fails to match in the string will change. Are there still sites out there that don't do this? Really?
-dave
http://millionnumbers.com/ - own the number of your dreams
they could just impliment a simple
if passwordcheck(password)=false then
wait random(15)
end if
OMG so very hard!
This is neither a new problem nor an unsolved problem. This problem stems from using functions like strcmp, which return as soon as a difference is detected, and are thus unsuitable for password checks. Solution? Set a flag when the first difference is found, and continue checking subsequent characters.
Palm trees and 8
that are used to check passwords and user names when people log into websites such as Twitter and Digg.
You forgot slashdot.
There used to be a similar timing problem in the days of WinNT with account lockouts. An attacker would throw guesses at a target, which would delay its responses slightly while the account wasn't locked out. Once the lockout threshold was reached, the response time dropped significantly. It was obvious, too; a human could easily distinguish between accounts that were and were not locked out.
Welcome back to 1997!
One that will always loop through the longest string (would need to figure out something to compare it to once past the end of the short string), even after it has decided they're not equal.
If I have been able to see further than others, it is because I bought a pair of binoculars.
Last time I coded a web based auth system, if you failed to log in it would refuse to check your next attempt until 10 seconds after the previous one (blocked by IP and by username). I, apparently foolishly, assumed most people would do the same...
That movie makes me cringe.
I thought most of the time just a hash of the password was transmitted, which would not allow this as the hash changes in multiples places when you change a specific location of the original password...
Looks like I'm safe...
I hate this kind of announcement because it usually ends up that they found a hack in a revesion Bozo's poorly constructed library from 5 years ago, but I like this kind of announcement because it makes me consider my security.
I'm using a PHP OpenID library that's using md5 for comparison in the database. I don't really see how that would be feasible, since even if you were cycling through characters you need all characters to make the hash which mysql is making its string comparison based on.
Or am I missing something?
The researchers also found that queries made to programs written in interpreted languages such as Python or Ruby -- both very popular on the Web -- generated responses much more slowly than other types of languages such as C or assembly language, making timing attacks more feasible. "For languages that are interpreted, you end up with a much greater timing difference than people thought," Lawson said.
Is there any situation where interpreted languages are actually faster than said other languages? ;-)
Move along people there's nothing to see here...
There is a difference between this type of timing attack and the timing attack used on the xbox 360/smart cards. In both cases, the attacker is submitting a key, and waiting to see how long it takes to process that key. The xbox 360 is a closed system, and the attacker has control over every aspect of the system (in the sense of a controlled scientific experiment). He can easily do the attack over and over, and be able to make it so that only the key changes. Something like OpenID is on the internet, though, and the attacker can't control every single aspect of the system he's attacking. There are numerous reasons why one key will take a different amount of time, with the server load and network load constantly changing. It is impractical to measure the difference of a couple of cpu cycles when there is so much noise.
The only way this will succeed is if these people have come up with a different technique to do the timing attack, but you still shouldn't compare them to people that are attacking a device sitting on their bench. The only thing that I can think of is submitting the same password hundreds or thousands of times, and averaging the amount of time. I'd think that this would appear to be a denial-of-service attack.
Wow, I remember reading something about a similar technique once. In an old text file written by some 80s hacker group. Or maybe it was that awful "Secrets of a Super Hacker" book. Either way, this HAS to be one of the oldest techniques known to anyone.
Clever and witty sig.
Do they have "permission"? Or will somebody come along and tell them they can't discuss it?
For justice, we must go to Don Corleone
Adding a random delay doesn't help. Just send in the request 100 times and take the average time.
Hey don't blame me, IANAB
Are you serious?
In the course of an entire web session's worth of CPU consumption, you are worried about the time taken to compare password characters? Any modern optimized processor should require one clock cycle per character.
Do you actually profile your code or do you just make funny noises? Or maybe you're running your web server on a Commodore 64?
How secure can any homogenous security system really be? I want to use a different login, password, and backend security mechanism on every single site that I have an account on.
Wouldn't locking out the account after X invalid attempts just block this anyway?
This was the first time-based side channel attack I learned. Within Minix you initially could place a password right at a page boundary and try and login. If there was a page fault before the password was rejected, you knew you had the right character right before the page bound. Of course, the solution is very simple: check all the characters for correctness, simply setting a boolean to false each time you find an incorrect character. Probably even better is to pad the input to a maximum length (in a time independent way), use a hash and always test the all the bytes in the hash.
Adding delays is costly and unnecessary, outside the fact that you might still detect something since the average random delay is probably a constant. Don't forget that these attacks already rely strongly on statistics. One thing that you can easily do with an online system is to add a delay after a bad attempt. If you add enough delay, a statistical attack may take simply too long a time (make sure sure you don't aggravate your users until they get a heart attack). Obviously, on an online system, you cannot *just* set a maximum amount of retries without handing a DoS attack to attackers.
Preventing side channels attacks is hard, and don't get illusions that they can be easily discarded because they are impossible to implement. They can be implemented and with the current state of cryptography, they are the one of the weakest points in many security protocols and algorithms. Within the SHA-3 competition it is definitely one area that is getting attention.
post a news story when an authentication scheme which /doesn't/ invite users to type their usernames and passwords into dozens of random websites is broken.
http://bash.org/?5775
Even Dread's killer gear was vulnerable to timing attacks. Of course he had a two-factor text&speech combination that the (arguable) heroine managed to get just by accident, but still - vulnerable to a timing attack.
I want to delete my account but Slashdot doesn't allow it.
In addition to the listed sites, I believe Facebook's Connect API uses OAuth for authentication... that's a LOT of users...
Grammar Nazi
A better example from the past of this same sort of attack was back in OpenSSH Portable. Specifically, OpenSSH/PAM timing attack allows remote users identification
Note that this didn't apply to finding passwords, just that invalid users would immediately return an error after the password was entered, while a valid user and incorrect password would have a delay.
GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
I always thought a big flaw in the movie War Games was that the launch code was figured out one character at a time. Now this happens and flips my world upside down.
The researchers also found that queries made to programs written in interpreted languages such as Python or Ruby -- both very popular on the Web -- generated responses much more slowly than other types of languages such as C or assembly language, making timing attacks more feasible. "For languages that are interpreted, you end up with a much greater timing difference than people thought," Lawson said.
Sure, scripts are slower than C. They're slower in general, but when you compare two binary strings, it's still mostly the same C memcmp call that's being called. You also have semi-random events like mark and swipe garbage collection, dynamic optimizations, I/O delays.
This means scripts may be slower and more random, while the password check call still isn't, how the heck would that make is easier to hack scripted sites?
I'm not even mentioning the fact most web apps don't have passwords hardcoded, but actually do the check in an external agent, say SQL database, making his observation even less logical.
He claims he can filter out all those variables, including network jitter and pinpoint the exact time of some ASM-level operation on a string. I say, show us.
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.
Why the hell are they checking against the password in plaintext, and not some kind of hash?
crypto.stanford.edu/~dabo/papers/ssl-timing.pdf
Are there still sites out there that don't do this? Really?
Unfortunately, yes.
Would that work?
If you were comparing plaintext passwords with strcmp you might expect something on the order of one character comparison per instruction cycle, say 1ns. But across the internet latency variance is very noisy and more like 1ms standard deviation, ie a million times larger. I'd expect you'd have to average billions of tests against each attempted character before that one little nanosecond comes out of the noise, if it's even detectable at all. Most likely there are slower clock domains along the way that will gobble it up completely.
I could imagine in a spectacularly well controlled lab environment with no other traffic on the lan and no other activity on the server, this might be demonstrated, but there's just too much jitter in any production system to do this.
Of course none of this excuses such a braindead authentication scheme. Use a hash!
sleep(rand());
How many more years will slashdot have an off-by-one error on your Score in your profile?
Hey look, another advertisement for irrelevant business gathering called "Blackhat".
Considering the quality and technical depth of presentations announced so far, I expect next presentation to be a shocking discovery about users choosing weak passwords.
Well done Businesshat.
Comment removed based on user account deletion
Three strikes. If the bot can't guess the password in a few attempts, it is not a sober user on a good connection. Lock the account and make them beg for reconnection via their known email address or some such.
This is VERY old technology.
--
The alternative to trial and error is usually error.
But .. get about 100 of such routines, unoptimized, and your program will slow down; for sure when there are multiple users involved with multiple access instances. Code optimizing is still a required part to keep a build clean, reliable and fast.
--- I am known for the ones who want to find me on the net. Is that a privacy risk or a privilege? One might wonder..
Comment removed based on user account deletion