Introduction
So the Internet has been exploding this week due to the Heartbleed Bug in OpenSSL which effects a LOT of servers and websites and is being hailed by some as the worst vulnerability in the history of the Internet thus far.
The main info on the bug can be found at http://heartbleed.com/. In basic terms, it allows you to grab 64kb chunks of whatever is stored in RAM on the server as long as it’s using a vulnerable version of OpenSSL with Heartbeat enabled.
The Heartbleed Bug is a serious vulnerability in the popular OpenSSL cryptographic software library. This weakness allows stealing the information protected, under normal conditions, by the SSL/TLS encryption used to secure the Internet. SSL/TLS provides communication security and privacy over the Internet for applications such as web, email, instant messaging (IM) and some virtual private networks (VPNs).
Who needs the NSA when we have this eh?
So ya this is really serious, a scanner was released before anyone had chance to patch it and huge sites like Yahoo! Mail were vulnerable and exposing user passwords to anyone who used Heartbleed against it.
Everyone scrambled to fix it fast though, which is good – as it’s a major vulnerability. As can be seen in this picture, the plain text user passwords for Yahoo! mail were being leaked.
Hashing is irrelevant in this case, as the hash and hash comparison are done on the server side, so the plain text password is stored in memory at some point.
The bad part of it is that there’s no way to tell if it’s been exploited as there’s no crash, no damage, it just spits out the data to whoever runs the exploit.
There’s a good analysis of the actual code involved here:
Diagnosis of the OpenSSL Heartbleed Bug
What Should I Do?
Well you need to check if any of the servers you manage or run are using a vulnerable version of OpenSSL, from my experience if you are still on Ubuntu 10.04 LTS you are safe from this, as it uses OpenSSL 0.9.8 without heartbeat functionality.
If you are using Ubuntu 12.04 LTS (any subversion) then you ARE vulnerable and need to update ASAP.
IF you want to scan your servers you can grab the scanning script here:
There are also a couple of online scanners you can use (just beware of false positives).
– http://rehmann.co/projects/heartbeat/
– http://filippo.io/Heartbleed/
On the server side, you can check your OpenSSL version with:
openssl version -a
Don’t pay attention to the version or date, but look at the build date – it should be AFTER April 7th.
Something like this would be a vulnerable version:
OpenSSL 1.0.1 14 Mar 2012
built on: Wed Jan 8 20:45:51 UTC 2014
After updating it should look like:
OpenSSL 1.0.1 14 Mar 2012
built on: Mon Apr 7 20:33:29 UTC 2014
How Do I Fix It?
For the majority of people, someone else probably hosts your sites and infrastructure, so you don’t need to worry that much – just change your passwords if you’re paranoid and make sure you enable 2 factor auth for anything that supports it.
Services like the Linode Nodebalancer with SSL termination have been updated, but do bear in mind your secret key could have been leaked (although, logically that’s pretty unlikely).
On Ubuntu 12.04 it’s as simple as doing aptitude update; aptitude safe-upgrade -y;
and then restarting all relevant services, or simply rebooting.
Ensure the build date is at minimum 2014-04-07.
If you want to check what services are using OpenSSL you can do:
lsof -n | grep ssl | grep DEL
That fixes the bug, but remember it doesn’t change the fact that your secret keys/passwords could have been leaked, there has also been reports of 2FA session tokens being leaked among other stuff.
So to be secure, you really need to revoke all your SSL certificates, regenerate a new private key and csr, and regenerate your SSL certs.
And of course, change all your passwords.
More Reading
– Amazon Linux AMIs are updated.
– Why Heartbleed is the most dangerous security flaw on the web
– Critical crypto bug exposes Yahoo Mail, other passwords Russian roulette-style
– Hacker News – The Heartbleed Bug
– Reddit – The Heartbleed Bug
Dominick says
Thanks for all the help on trying to make sure we stay protected from this huge bug! Keep updating us with more ways to protect ourselves!