Hijacking user sessions with the Heartbleed vulnerability
mattslifebytes.com
mattslifebytes.com
Two years is a long time, people. If ordinary people can write proof of concepts in less than 24 hours after it is publicly disclosed, what to think of those getting paid to find and abuse such bugs? I mean, what are the odds this bug was not abused in production environments the past two years?
Coincidence, could be. But probably not.
It was low-priority, but looking at the passwords that people have captured from yahoo's servers, I used a very very common password theme. Also, a lot of Yahoo users were born between 1970 and 1975.
Client web browsers are not affected because:
Firefox uses NSS on all platforms.
Chrome uses NSS on Linux or platform libraries for SSL or uses NSS on all platforms for SSL, and then uses the system libraries for other cryptographic operations and certificate validation.
Platform-specific browsers (IE, Safari) likely use their platform's SSL code.
Almost every other mainstream browser is a derivative of one of the four mentioned so far.
Edit: As another commenter pointed out, client-side consumers of the OpenSSL library are likely affected as well. That means web spiders and server-side code that uses web APIs are likely affected. That may or may not be concerning, depending on the networks that traffic travels over and the method of authentication.
- All affected sites need need to update OpenSSL, reissue certs, tell users to update their passwords.
- All users need to reset their passwords, using a unique password for each site if possible. If they can't feasibly use unique passwords for each site, they need to make sure they don't use their new password on sites that aren't fixed yet.
That's pretty crazy, and getting anything close to 100% compliance is going to require a ton of visibility.
Someone should make a browser extension as quickly as possible to tell users if they're visiting a yet-unfixed site.
Basically: this vulnerability must be patched, or the server must be taken offline, and that needs to happen everywhere.
No one is arguing against that. The point is that from the user's point of view, they shouldn't interact with a server at all if it is still vulnerable to this attack.
Scary...
But every time you connect you are sending a cookie which allows for session hijacking.
So the -NSA-mafia can go get the private key from a vulnerable server, MitM its clients, and attack those clients too.
Nasty stuff. And in the last day, even those agencies that didn't know about the vulnerability beforehand have likely spidered the entire web scraping everyone's keys just-in-case.
# ./hb-test.py mail.yahoo.com |grep -A3 -B3 pass64k of random memory is bad, 64k of OpenSSL's state is worse.
Also, why haven't Yahoo taken down their login service yet? I really don't see how leaving your users' passwords leaking in plaintext is ever better than downtime. Someone had to have made that call, and I really don't think it was the right one. Will be interesting to see how the media treats this over the next few days.
EDIT: Looks like Yahoo is finally fixed. Wonder how many accounts were compromised in the interim, and if their cert and private key were compromised as well. Does not look like they've re-issued yet.
1.) Client sends Plain text user/pass over SSL -> 2.) Server reads that info to memory -> 3.) Server hashes password and tests hash -> 4.) Server discards plaintext memory.
Whats happening here with heartbleed, is you are reading the RAM of the server, so before Yahoo even has the chance to hash the password, this exploit allows you to read the password.
Remember, even though Yahoo may only store the hashes in the database, your password (for any service) is still being sent effectively as cleartext.
Yahoo hopefully/presumably store only password hashes at rest, but just as in almost any system the user's real, clear password has to be sent from the user to the server to hash and verify against the database in order for the user to log in. Yahoo were following best practices by sending this password encrypted over HTTPS, but this vulnerability is a particularly insidious one because it actually punishes sites for doing the right thing in the form of encrypting traffic.
Because of the particular memory read using this attack and the memory layout Yahoo's service ended up with, other users' decrypted login traffic would get sent back to malicious clients with high frequency.
Additionally, there's a chance an attacker could compromise the TOTP secret as well as it will probably be in memory around the same time (unless the system is using a keyserver or HSM). At that point, the whole setup is blown and the user's credentials could presumably be replayed.
Thus, the key exchange doesn't need to be exposed for heartbleed to have a good potential to leak TOTP/2FA secrets.
You should be able to simply move the TOTP operation to an authentication server on a more secure network and have your web-application server query it with the user's token. The web app will get back the result of the operation and never expose the secret key to the bastion host.
https://github.com/musalbas/heartbleed-masstest/blob/master/top1000.txtI'd like to start changing passwords, but it doesn't do much good until things are fixed.
For fun and for research purposes, in the past I've set up SSL dumps that just log all the TLS commands and sort them by frequency. The ones at the top and at the bottom of the list were the most interesting.
But yes, generally you're right, and this circumstance is obviously different from that one.
They hope exploits carry forward into newer firmwares so that they can use them to find newer exploits introduced in that firmware so when they use the previous exploits, they can use the news ones when SONY patches the older and explore what SONY did to fix it; learn more about how SONY's devs think.
It may turn out that the space in memory it's returning from is useless. Or, like yahoo, you may be giving out plain-text ASCII passwords to complete strangers who can type a command line. Which of these two extremes you get is largely based on luck.
EDIT: The other thing is that it seems better to check for "Server Hello Done" at the end of the handshake message as some servers seem to send all submessages within one handshake message (though not sure if they're OpenSSL-based), i.e. look for ord(pay[-4]) == 0x0E rather than at ord(pay[0]).
hb = h2bin('''
18 03 02 00 03
01 40 00
''')
See that "40 00" there? That's hex and 0x4000 = 16384. Change it to something like "02 00", so it's 0x200 = 512, or 0x400 = 1024 ...or whatever you want.(But keep it at a power of 2... I assume).[1] https://gist.github.com/tintinweb/10411753 | hb-test.py aka heartbleed.py
What are the possibilities of using public key cryptography in the browser? For example, I upload my public key to some website, create an account which is locked to my private key. I get the convenience of not having to log in manually and some extra safety.